Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <sys/wait.h>
- pid_t getpid(void);
- pid_t getppid(void);
- int main(){
- int i=0,j=0,pid,k,x;
- pid=fork();
- if(pid==0){
- for(i=0;i<20;i++){
- for(k=0;k<10000;k++);
- printf("Child: %d\n",i);
- }
- }
- else{
- wait(0);
- printf("**** Wznowienie rodzica **** \n");
- for(j=0;j<20;j++){
- for(x=0;x<10000;x++);
- printf("Rodzic: %d\n",j);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement