Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <unistd.h>
- int main()
- {
- printf("Пример буферизации!\n");
- fflush(stdout);
- pid_t pid = fork();
- if (pid == 0)
- {
- printf("SON %d has father %d\n", getpid() ,getppid());
- }
- else
- {
- printf("FATHER %d has father %d\n", getpid() ,getppid());
- }
- wait(NULL);
- printf("The End\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement