Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Misiu malowany, powiedź mi co ja mam źle w tym programie z procesem init, kompilator wariuje i w ogóle nie jest mi wstanie tego wywołać :/ dwa pokazuje mi error w przydaku gdy Getpgid( tutaj chce dać pid ) ;
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/types.h>
- #include <unistd.h>
- int mian()
- {
- pid_t pid=fork();
- for(int i=0;i<3;i++)
- switch(pid)
- {
- case -1:
- perror("Blad funkcji fork()");
- exit(2);
- case 0:
- printf("Getuid: %u\n",getuid());
- printf("Getgid: %u\n",getgid());
- printf("Getpid: %u\n",getpid());
- printf("Getppid: %u\n",getppid());
- printf("Getpgrp: %u\n",getpgrp());
- sleep(3);
- break;
- default:
- _exit(2);
- break;
- };
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement