Question: 2. Consider the following program. [10 pts int main) pid.t pid; pid fork if (pid 0) fork; fork printf (Hello world! ); else if (pid

2. Consider the following program. [10 pts int main) pid.t pid; pid fork if (pid 0) fork; fork printf ("Hello world! "); else if (pid > 0) fork printf("Hello world! "); (a) How many lnes of Hello world! will be printed? (b) How many processes including the main process will be created when this code runs? 2. Consider the following program. [10 pts int main) pid.t pid; pid fork if (pid 0) fork; fork printf ("Hello world! "); else if (pid > 0) fork printf("Hello world! "); (a) How many lnes of Hello world! will be printed? (b) How many processes including the main process will be created when this code runs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
