Question: Consider the following code: 1 int child = fork ( ) ; 2 int c = 5 3 if ( child = = 0 )
Consider the following code:
int child fork;
int c
if child
c ;
else
child fork;
c
if child
c ;
a Including the initial parent process, how many processes are created by this program?b In each of process, what is the final value of variable cc Suppose a program calls fork n times. Proof: Including the initial parent process, there will ben processes in total.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
