#include #include #include #include #include #define FIFONAME "/tmp/xyz.xyz" int main(void) { int fd; if (mkfifo(FIFONAME, 0600) < 0) { perror("Error"); exit(1); } fd = open(FIFONAME, O_WRONLY | O_NONBLOCK); if (fd >= 0) { puts("This should not happen."); close(fd); } else if (errno == ENXIO) { puts("No process is reading from the other end."); } remove(FIFONAME); return 0; }