C with Linux Fill in the blank Task 2 50 points To create a

C with Linux - Fill in the blank

Task 2\" (50 points) To create a new process, you can use the system call fork(void). Incomplete code is given below. The with proper code. It should fork (void)system call is used to create a child process. Replace the work as follows. .._.._w For the parent process, the program will print out \"Parent Process: Global variable: 4 Function variable: 22\" For the child process, it will print out \"Child Process: Global variable: 3 Function variable: 21\"

Solution

In first fill in the blank:

fork(); //use to create a child process

In second fill in the blanks:

if(pid<0) this is the case when fork() is not able to create child process

In third fill in the blanks:

else if(pid=0) creates child process

In fourth fill in the blanks:

else ( pid>0)

C with Linux - Fill in the blank Task 2\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site