Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

2 What people-related issues do you foresee?

Answered: 1 week ago