I am working with pipes and one pipe won't open, even though mkfifo()
was successful.
I have this:
/* create the FIFO (named pipe) */
int ret_mk = mkfifo(out_myfifo, 0666);
if(ret_mk < 0) {
perror(out_myfifo);
unlink(out_myfifo);
return -1;
}
printf("ret_mk = %d\n", ret_mk);
/* write to the FIFO */
out_fd = open(out_myfifo, O_WRONLY);
printf("out_fd = %d\n", out_fd);
but nothing gets printed after open()
, even a print of random text won't show up.
From here we have:
The
open()
function returns an integer value, which is used to refer to the file. If unsuccessful, it returns -1, and sets the global variableerrno
to indicate the error type.
What can I do to see why it won't open?