Question
C program with three consecutive fork statements such that each fork process runs an infinite loop printing from process (process id) every two seconds. USing
C program with three consecutive fork statements such that each fork process runs an infinite loop printing "from process (process id) every two seconds.
USing the system call setpgid(), ensure that all the descendants of the main process other than its immediate children are terminated upon entering CTR-C
Each of the terminated non-descendants process must print its pid and ppid along with a short message stating that it has been terminated
after the non-child process have been terminated, the main program and its direct desccendants must take turns every 2 seconds to print the statement "This is from process(process id)"
there should be no interleaving of print statements from different processes and they must be printed from each process in the order listed below ccontinuously (starting with main): Note : you must implement this using SIGSTOP and SIGCONT
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started