Question: Look at the two programs prt and pr2 in the document linked below. Assume pe always executes first and is invoked as follows/pr1 OS21_xam_codard How

Look at the two programs prt and pr2 in the document linked below. Assume pe always executes first and is invoked as follows/pr1 OS21_xam_codard How many unique processes do the programs pr1 and pr2 create when executed, including the initial process Provide a brief explanation (Hint while you can't submit a process tree to support your answer, you may want to draw one to help figure out your response) For the foolbar, press ALTF10 (PC) or ALT+FN+F10 (Mac) TTT Aral (12p01 E- Qis Process management questions (definitions for programs prl and pr2) prl: pr2: int main(int argc, char **argv) { int main(int arge, char **argv) { pid_t pidi, pid2; pid_t pid; pidl - fork(); if (pidi - 0) { printf ("P1 child "); execlp("./pr2", "pr2", "fork 1", NULL); printf ("P2 %s ", argv[1]); pid - fork(); if (pid > 0) { wait (NULL); printf ("P2 parent 88 ", argv[1]); ) else if (pid == 0) printf ("P2 child & ", argv[1]); return 0; else { printf("P1 original "); wait (NULL); pid2 = fork(); ) if (pid2 - 0) { printf ("Child of P1 "); I execlp("./pr2", "pr2", "fork 2", NULL); ) else { printf ("Still P1 original "); wait (NULL); ) 1 return 0; ) Note: prl always runs first and is invoked with the command line: . /pril
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
