#include #include #include #include int main(void) { char buf[100]; int fd = open("file.fifo", O_NONBLOCK|O_WRONLY); if (fd < 0) { fprintf(stderr, "error (%d): %s\n", errno, strerror(errno)); return 1; } sprintf(buf, "%s\n", "a new line"); int bytes = write(fd, buf, strlen(buf) + 1); printf("wrote %d bytes", bytes); close(fd); return 0; }