Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fcntl.h>
- #include <stdio.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define MAX_BUF 1024
- int main()
- {
- int fd;
- char * myfifo = "/tmp/myfifo";
- char buf[MAX_BUF];
- /* open, read, and display the message from the FIFO */
- fd = open(myfifo, O_RDONLY);
- read(fd, buf, MAX_BUF);
- printf("Odebrano: %s\n", buf);
- close(fd);
- fd = open(myfifo, O_WRONLY);
- write(fd, "Nie.. Nie.. To niemożliwe !!!", sizeof("Nie.. Nie.. To niemożliwe !!!"));
- close(fd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement