Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- int main()
- {
- int fd[2];
- char buf[100];
- pipe(fd);
- if(fork()==0)
- {
- sleep(5);
- write(fd[1], "Hello", 6);
- }
- else
- {
- // czeka na powrot z write
- read(fd[0], buf, 6);
- printf("%s\n", buf);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement