Question: #include #include #include #include int main() { pid_t pid; pid = fork(); if (pid fprintf(stderr, Fork failed. ); return 1; } else if (pid ==

 #include #include #include #include int main() { pid_t pid; pid =

#include

#include

#include

#include

int main()

{

pid_t pid;

pid = fork();

if (pid

fprintf(stderr, "Fork failed. ");

return 1;

}

else if (pid == 0) { /* child process */

execl("./long1", "long1", NULL);

}

else { /* parent process */

wait(NULL);

printf("Parent says: child has exited. ");

}

return 0;

}

5. Programming Assignment. Modify the program orphan_hw3.c so that the child process becomes an orphan process. If you wish to work in C++, you can do so; you will need to modify the file orphan_hw3.c accordingly. Running the program: make sure that the executable file long1 is in the same directory as your orphan program. Capturing process information. Use the script hw3_check.sh to capture process informa- tion as you run your program. To do so, you will need to execute your modified orphan_hw3.c program and then immediately execute hw3_check.sh. The script will save the information in a text file. What to hand in: submit your modified version of orphan_hw3.c along with a README.txt file containing the output from the text file generated by hw3_check.sh along with a brief explanation of what you observed

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!