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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started