Question: System Programming and Process Management (in C programming language) You are asked to develop basic system programming including process creation and termination on a Linux

System Programming and Process Management (in C programming language) You are asked to develop basic system programming including process creation and termination on a Linux platform in this part of programming project. You are asked to create multiple children processes to work under one parent process. In theory, children processes can do their own work separately or cooperatively to accomplish a task. In this assignment, these children processes simply print out a hello message together with their PIDs (process IDs) and exit. You should use fork() and wait() system calls to implement this program. Requirements: 1. Take the number of children processes as an argument when the parent process creates children processes. This argument should be passed through a command line argument. 2. The parent process creates children processes and should print out an error message if creation fails. The parent process should also wait for all children processes to finish and then exit. 3. Each child process should print out a hello message together its PID and then exit. 4. Test with 2, 4, and 8 children processes. 5. Next, instead of creating multiple children processes of a parent process, you are asked to create a chain of processes, i.e. the parent process will create one child and wait for it to finish, while the child creates its own child and wait for it as well, and so on. The last child created should print out the message and exit immediately so that its ancestors can finish too. Test your program with 2, 4, and 8 children processes again. 6. Develop a Makefile, similar to the one we will discuss in lecture to automate the compilation process. 7. Develop a shell script to automate the test process, i.e. to test with 2, 4, and 8 children processes for both versions of program automatically with this script. Hints: System calls getpid() and getppid() return a process ID and the parent process ID, respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
