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-1 section.
Project 1: 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 (1-4):
The user interacts with the program by entering an integer: 1,2,3, or 4. 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 C :
int choice;
scanf("%d", &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 "1. 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 "2. 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 2
kill" for more details of how to terminate a process.
Action for "3. 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 10 child processes will exist at the same time.
Action for "4. Quit": terminate the program. You need to terminate ALL created and existing child
processes before terminating the main program.
 needs to use Linux Process to finish this project needs to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!