Page 1 of 1

For this assignment, you will use C's process control functions to exercise basic process creation. Your program should

Posted: Sat Nov 27, 2021 10:37 am
by answerhappygod
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 1
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 1 (81.85 KiB) Viewed 55 times
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 2
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 2 (75.89 KiB) Viewed 55 times
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 3
For This Assignment You Will Use C S Process Control Functions To Exercise Basic Process Creation Your Program Should 3 (43.83 KiB) Viewed 55 times
For this assignment, you will use C's process control functions to exercise basic process creation. Your program should have the following functionality: Concurrency Given up to six commands separated by commas (a comma will be its own token, with whitespace around it) and any number of arguments each, execute all commands concurrently (i.e., in parallel and not one after the other) Each process (excluding the parent) should print their PID followed by their PPID followed by their command without arguments to stderr. Any normal behavior by the command issued should remain the same. You do not need to account for redirection or pipelining. Your program should not produce orphans. Toward verification of this, if a process's PPID is 1, it is an orphan that has been adopted by the init process. In solving this problem, be sure that your child processes still run concurrently. Do not wait for one process to complete before starting a new one. Example $ annignols- apud cat hello.txt PID: 35003, PPID: 35002, CMD: 15 PID: 35004. PPID: 35002, CMD: pud PID: 35005, PPID: 35002, CMD: cat /home/silvestro Assignment 6: Process Control Page 1 of 3 courses Denktop Downlonds this is the contents of hello.txt Note that since the processes are happening in parallel, the order of the output is not guaranteed

Compiling Your Program Your submission will include a makefile so the following command can be used to compile your code $ make assign6 This should produce an executable file named assign6. For more information about the make utility check the related document on Blackboard. If you attempt the extra credit. $ make assign6-ec should compile the extra credit portion to assign6-ec. Extra Credit (25 points) Create a second program, assign6-ec which takes exactly two commands with any number of arguments each, and separated by a comma. The program should pipe the output of the first command to the second using dup20. Example $ assign6-ec ls -1 sort -k5 -- should behave as $ ls -1 sort -5 Extra credit is not given to late assignments All requirements must be met for both parts of the assignment to qualify for extra credit. Assignment Data This assignment does not include sample input files since it will only take arguments Program Files Your submission should consist of up to five files • assign6.c - the main file which is compiled (required) . assign.h - an optional header file if necessary • assigné-ec.c- the main file which is compiled for extra credit (required for extra credit) • assiga6-ec.h - an optional header file if necessary

Program Files Your submission should consist of up to five files: • assign6.c - the main file which is compiled (required) • assign6.h - an optional header file if necessary • assign6-ec.c- the main file which is compiled for extra credit (required for extra credit) • assignb-ec. h - an optional header file if necessary Assignment 6: Process Control Page 2 of 3 • Makefile the makefile to make the assign6 executable (required)