Question: Using C To create a new process, you can use the system call fork. Incomplete code is given below. The fork system call is used

Using C  Using C To create a new process, you can use the

To create a new process, you can use the system call fork. Incomplete code is given below. The fork system call is used to create a child process. Replace the follows. with proper code. It shoukd work as . For the parent process, the program will print out "Parent Process: Global variable4 Function variable: 22 . For the child process, it will print out "Child Process: Global variable: 3 Function variable: 21" #include | #include | #inelele int globalVariable2 int main char parentStr"Parent Process" char ehildstrChild Process char *string NULL int functionVariable20 // Create child process pid_t pid ir/Failed to fork perror("Unable to create child process) return ; else i C77 ehild // Code only ezecsted by child process string kc hi ld Str[01; globalVariable++ functionVariable++ pares // Code only ezecated by parent process stringkparentStr [0] globalVariable 2 functionVariable2 / Code ezecated by both parent and child printf(*%s ". string ); printf(* Global Variable: %d.n..globalVariable); printf(* Fonction Variable : %d ". functionV,ariable); Tasklc

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!