Question: 2 int main ( ) 1 pid _ t smith; int a = 2 ; int b = 3 ; smith = fork ( )

2
int main ()
1
pid_t smith;
int a=2; int b=3;
smith= fork();
if )==(01
fork() ;
a++;
fork () ; / BEWARE */
}
else if (amith>0){
b++;
fork (); / BEWARE +/
}
printf("8d 8d,a,b;
Here is the code for a program named Agent_Smith.c. Including the initial parent process,
A) How many Agent_Smith processes are created? Assume there are no errors.
B) Draw the process tree showing the up-to-date variables a and b.(Anonim olmayan soru (1))[]
 2 int main () 1 pid_t smith; int a=2; int b=3;

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!