Question: Processes Answer the following questions, considering the following C code and a program pin obtained by compiling it with gcc: int main ( int argc,char
Processes
Answer the following questions, considering the following C code and a program pin obtained by compiling it with gcc:
int mainint argc,char argv
int n atoiargv;
printfPIN NUMBER for d:
n;
int pid fork;
if pid
n ;
int pid fork;
if pid
n ;
else
n ;
else
n;
if fork
n;
n;
printfdn;
return ;
a How many input takes the program pin?
b What are the values of variable pid and pid
c Briey explain what does the function fork do:
d How many times the printf function is called:
e Draw clearly the process graph, marking the modifications happening to the number n:
f Suppose that the number n is initially provide a feasible ouput for the program:
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
