#include #include #include #include #include #define MAX_BUF 1024 int main() { int fd; char * myfifo = "/tmp/myfifo"; pid_t pid = getpid(); /* write "Hi" to the FIFO */ fd = open(myfifo, O_WRONLY); char str[80]; sprintf(str, "pid=%d COSC330 is cool", pid); write(fd, str, sizeof(str)); //close(fd); close(fd); /* remove the FIFO */ //unlink(myfifo); return 0; }