Question: Step 7 . Rewrite the program in Step 1 . , so that the child process runs the ls command, and that the parent parent

Step 7. Rewrite the program in Step 1., so that the child process runs the ls command, and that the parent
parent process waits until the child process terminates before it exits. Demonstrate your code to the TA.
You may use the following code snippet.
else if(pid ==0)
{
execlp("/bin/ls","ls", NULL);
}
else
{
wait(NULL);
printf("Child Complete");
exit(0);
}

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!