Question: Write a C program to illustrate the concept of orphan process. Parent process creates a child and terminates before child has finished its task. So
Write a C program to illustrate the concept of orphan process. Parent process
creates a child and terminates before child has finished its task. So child
process becomes orphan process. The output should be similar to the
following image.
Note that when you run your code the processes IDs will be different than the image given
belowyou can use fork sleep getpid getppid
I am the parent with PID and PPID
My child's PID is
PID terminates.
Im the child with PID and PPID
PID terminates.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
