Question: Using the program in FIG 3 , identify the value printed at line A , B , C , and D . ( Assume that
Using the program in FIG identify the value printed at line A B C and D
Assume that the actual system process ID of the parent is and the child is
Possible values
A pid or or
B pid or or
C pid or or
D pid or or
FIG
int mainvoid
pidt pid pid;
pid fork; fork a child process
pid;
if pid error
fprintfstderr "Fork Failed";
return ;
else if pid child
printfpid d
pid; A
printfpidd
pid; B
else parent
waitNULL;
printfpid d
pid; C
printfpidd
pid; D
return ;
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
