Question: in linux Write a very simple program that will show the possibility of having zombie processes. Write a program named zombie.c The main process will
in linux Write a very simple program that will show the possibility of having zombie processes. Write a program named zombie.c The main process will create a child. The child prints something like: I am the child with pid .. and my parent has ppid . Next, the child will sleep for 1 second. Child exits. The parent will print: I am the parent and my id is Next, the parent sleeps for 30 seconds. Since the child ends first, and the parent didnt do wait( ), the child will be for a while in the zombie state. Run the parent in the background, so you can use the top command and identify the zombie, before the parent terminates. Note: even if the parent terminates, the child is still a zombie. However the the init process reaps the zombies frequently.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
