Create a C program with the following process synchronization behavior. This synchronization process continues forever. You need to provide your own signal handling functions in the Parent, Child 1, Child 2, and Child3, each printing out a message with the cumulative number of signals received.

Respuesta :

Answer:

hope this helps,do consider giving brainliest

Explanation:

int main() {

int i,pid; printf("pid : %d \n",pid);

pid=fork();

printf("pid : %d \n",pid);

printf("\n");

if(pid==0) {

printf("Child starts\n");

for(i=0;i<5;i++) {

printf("i : %d\n",i);

printf("\n");

}

printf("Child ends\n");

}

else {

printf("\nBefore wait\n");

printf("getpid : %d\n",getpid());

pid=wait(0);

printf("\npid : %d\n",pid);

printf("After wait\n");

printf("Parent\n");

printf("getpid : %d\n",getpid());

}

}

Q&A Education