Question: needs to use Linux Process to finish this project needs to submit all source code files ( . c files ) to Project - 1
needs to use Linux Process to finish this project needs to submit all source code
files c files to Project section.
Project : Design the Process Management System:
The program, once executed, should print the following interface for user to choose:
Create a new process
Terminate a process
Print active processes
Quit
Your choice :
The user interacts with the program by entering an integer: or Each number triggers a
unique action. After completing the corresponding action, the program displays the same menu again,
prompting the user for the next integer input.
Regarding how to receive user input integer in :
int choice;
scanfd &choice; this function will block the program until user types an integer and hit
"Enter" key
after this line, variable "choice" will hold user input integer.
Action for Create a new process":
The program should create a new child process, which will go the infinite sleep. Refer to code
forkMANY.c This is the ONLY place that your code can call sleep function.
Action for Terminate a process":
The program will ask receive user input integer PID of the process to terminate. If the PID is valid
process with that PID was created and exists then the program kills the process with that PID;
otherwise, the program prints no such PID" and goes back to the interface again. Refer to "man
kill" for more details of how to terminate a process.
Action for Print active processes":
The program should print all PIDs that were created and are still existing in the system. For your
convenience, assume that at most child processes will exist at the same time.
Action for Quit": terminate the program. You need to terminate ALL created and existing child
processes before terminating the main program.
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
