Hello I need help writing the code for the question below: Write a C program con
ID: 3793655 • Letter: H
Question
Hello I need help writing the code for the question below:
Write a C program consisting of 3 processes, that is, one parent process that forks 2 child processes. Each process will print its process ID and its parent’s process ID. While the first process (P1) will wait for the remaining child processes (P2 and P3) to terminate, they will perform the following:process P2 will execute the ‘ps –ael’ command (using one of the exec() commands, not system()) and process P3 will execute the ‘ls’ command. This should be done using one of the exec() commands, not the system() call. The results of P2 and P3 will be written to separate files (i.e., P2_file.txt and P3_file.txt). After running your program, you will construct a process tree diagram (see Fig. 3.8 in the textbook) showing the hierarchy of processes all the way up to the init process for these processes in this program. This may require a review of Systems Programming.
Explanation / Answer
Answer:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.