Question: CIS 370 1. Process Creation in Linux: Run the code below in the CLI and answer the questions that follow mainca printfgetpid)) printfCeetpld)) printf getpld))

 CIS 370 1. Process Creation in Linux: Run the code below

CIS 370 1. Process Creation in Linux: Run the code below in the CLI and answer the questions that follow mainca printfgetpid)) printfCeetpld)) printf getpld)) a. How many processes are created (including the program itself)? b. Add a third fork t) right after the ones in the program. How many processes are there? c. What is the relation between the number of consecutive fork calls and total number of processes created? Use shell command pstree to capture the relations between the different processes of parts and b. (hint: use the shell command ps to get your shell process pid; then use pstree -p) d. PLD TTY STAT TIE COPPA 2 ttyl8:80 /bin/bash 148 ty2e: bin/bash Part 10(22033) asonpstree 2 p Run the code after modifying it as follows: o Comment sleep(10) o Add two more fork() calls (a total of 5 times) e. Run the code multiple time. Why does the parent of some processes change (sometimes init process (PID-1) and sometimes the CLI)? Modify your code to make sure that a parent process will not terminate before any of its children f. Note: All labs are due before next week's lab starts

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!