Question: 7.Consider the code below that uses the fork system call: 8.#include int main() {printf(%d ,getpid()); fork(); // fork A printf(%d ,getpid()); fork(); // fork B
7.Consider the code below that uses the fork system call:
8.#include
int main()
{printf("%d ",getpid());
fork(); // fork A
printf("%d ",getpid());
fork(); // fork B
printf("%d ",getpid());
fork(); // fork C
printf("%d ",getpid());
return 0;}
Answer the questions below.
a.How many processes are created in total by this program (not including the original process).
b.Identify the parent/child relationships between the processes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
