Horje
example code of waitpid Code Example
example code of waitpid
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <string.h>

int main(){
	int pid;
    int status;
    pid =fork();
    if(pid<0){
        printf("Error");
    }
    else if(pid==0){
         // Child Process
         for(int i=0;i<100;i++){
            value-=1;
            printf("%d \n",value);
         }
        exit(EXIT_SUCCESS);
    }
	
   waitpid(pid,&status,0); // WAIT till child gets over
	// Parent process
   for(int i=0;i<100;i++){
            value-=1;
            printf("%d \n",value);
         }
   printingFunction();
    if (WIFSIGNALED(status)){
        printf("Error\n");
    }
    else if (WEXITSTATUS(status)){
        printf("Exited Normally\n");
    }
    return 0;
    
	}
}




Whatever

Related
redis retrieve value as string Code Example redis retrieve value as string Code Example
error: Permission denied @ apply2files - /usr/local/lib/node_modules/@vue/cli/node_modules/vue/src/platforms/weex/.DS_Store Code Example error: Permission denied @ apply2files - /usr/local/lib/node_modules/@vue/cli/node_modules/vue/src/platforms/weex/.DS_Store Code Example
monospace letters Code Example monospace letters Code Example
how much does mano house cost Code Example how much does mano house cost Code Example
remove arrow spinners in styled component Code Example remove arrow spinners in styled component Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7