Question: Given the following code for Program 1 (that forks a child process that becomes a zombie process), create a new program that does #1 automatically
Given the following code for Program 1 (that forks a child process that becomes a zombie process), create a new program that does #1 automatically so you do not have to enter the commands ps and kill manually. Your program has to: (a) create zombie processes by running your C program of #1, (b) Obtain the state of each process and find if there is any process that is zombie, (c) Show a list of processes with their states, (d) kill the parent of any process that is zombie, and (e) show the updated list of processes with their states.
Please comment or explain the program 2 code.
Program 1 code:
#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
