Question: (e) The following code uses fork0, wait) and exec) functions. Explain, using an example what the code does at the places indicated. argv contains the

 (e) The following code uses fork0, wait) and exec) functions. Explain,

(e) The following code uses fork0, wait) and exec) functions. Explain, using an example what the code does at the places indicated. argv contains the values cp file1 and file2 where cp is the linux copy function. (8 marks) void function1 (char "argv) pidt pida pid data type int status if ((pid forkO) 0) "what happens here "/ prERROR: forking child process failedin"), exit(42), else if (pid0) if (execvp(argv, argv)

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!