#include #include #include #define FIFONAME "myfifo" int main(void) { int n, fd; char buf[1024]; if ((fd = open(FIFONAME, O_RDONLY)) < 0) { perror("open"); exit(1); } while ( (n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n); close(fd); exit(0); }