C programming: operating systems

please read the attach file, everything you need is in that file. Important thing to note: Your program should be developed in Linux environment. No credit will be given if it doesn’t compile (very important)Lastly, always comment so I know what is going on in the program

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

2-Write a C program that forks a child process that ultimately becomes a zombie process. This zombie
process must remain in the system for at least 10 seconds. You can obtain the process states using the
command in the shell:
ps -1
The process states are shown below the Scolumn; processes with a state of Z are zombies. The process
identifier (pid) of the child process is listed in the PID column, and that of the parent is listed in the
PPID column.
Perhaps the easiest way to determine that the child process is indeed a zombie is to run the program
that you have written in the background (using the &) and then run the command ps -1 to determine
whether the child is a zombie process. Because you do not want too many zombie processes existing in
the system, you will need to remove the one that you have created. The easiest way to do that is to
terminate the parent process using the kill command. Following screenshot is obtained after running
the program. Here, the process id of the parent (of zombie process) is 1499. Therefore, entering
kill -9 1499
terminates the zombie process.
Ayseguls-HP: cuhadars pa -1
UID PID PPID
F CPU PRI NI SZ
501 724 723 4006 031 04296240
501 1499 724 4006 03104267728
501
1500 1499 2006 0 0 0
0
501 1485 1484 40
031 04296240
Ayseguls-MBP.- cuhadars kill -9 1499
Ayseguls-:- cuhadars
RSS WCHAN
1700 –
788
0
1680
S
S+
2+
ADDR TTY
0 ttys000
o ttys000
0 ttys000
0 ttys001
TIME CMD
0:00.33 -bash
0:00.00 ./ zombie
0:00.00 (zombie)
0:00.05
)
Follow the steps below in writing your code:
1. Create a child process
2. Have the parent sleep for a specified amount of time and return without invoking wait
Submit your solution as MyNamePart1.c

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER