Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //proces P4
- switch(potomki[4] = fork()){
- case 0:
- {
- //proces P9
- switch(potomki[9] = fork()){
- case 0:
- {
- printf("P9:%d:%d\n", getpid(), getppid());
- exit(0);
- }
- case -1:
- printf("Blad funkcji fork");
- exit(1);
- default:
- wait(NULL); //oczekiwanie na zakończenie procesu potomnego
- }
- printf("P4:%d:%d:%d\n", getpid(), getppid(), potomki[9]);
- exit(0);
- }
- case -1:
- printf("Blad funkcji fork");
- exit(1);
- default:
- wait(NULL); //oczekiwanie na zakończenie procesu potomnego
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement