Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>a
- #include <unistd.h>
- #include <stdio.h>
- int main()
- {
- //fork();
- printf("ID PROCESU = %d\n", getpid());
- int ema=fork();
- wait();//poprzedni proces sie zamyka i trzeba go poczekac. getppid=1
- switch(ema)
- {
- case -1: printf("blad %d %d\n",getpid(), getppid());break;
- case 0: printf("dobrze %d %d\n",getpid(), getppid());break;
- default:printf("default %d %d\n",getpid(), getppid());break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement