Question: Modify this so that parent process calls waitpid() FOR EACH child before printing its hello to the world #include #include #include int main pid_t child_1,

Modify this so that parent process calls waitpid() FOR EACH child beforeModify this so that parent process calls waitpid() FOR EACH child before printing its hello to the world

#include #include #include int main pid_t child_1, child_2; child-1 = fork(); sleep(rand() % 5 +1); if (child_1) printf(" child 1 :-> Hello " else child-2 = fork(); sleep(rand() % 5 +1); if (child_20) printfC"child 2:HelloIn else return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!