15 lines
279 B
C
15 lines
279 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main(){
|
||
|
int res = fork();
|
||
|
if(res>0){
|
||
|
printf("Jestem rodzicem [%d] [%d]\n", res, getpid());
|
||
|
res=wait(NULL);
|
||
|
printf("Zakonczono proces [%d]\n", res);
|
||
|
}
|
||
|
else if (res == 0){
|
||
|
printf("Jestem potomkiem [%d] [%d]\n", res, getpid());
|
||
|
}
|
||
|
return 0;
|
||
|
}
|