Question: This problem tests your understanding of Unix process control. Please draw a fork diagram (tree parent and child)and explain every step. int main() { int
This problem tests your understanding of Unix process control. Please draw a fork diagram (tree parent and child)and explain every step.
int main() { int status; int counter = 1; if (fork() == 0) { counter++; printf("%d", counter); } else { if (fork() == 0) { printf("5"); counter--; printf("%d", counter); exit(0); } else { if (wait(&status) > 0) { printf("6"); } } } printf("3"); exit(0); } Select each of the following strings that is a possible output of the program. Could be multiple outputs.
A) 253063
B) 251633
C) 520633
D) 506323
E) 263503
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
