Question: 1. Type the following program and make sure you include the header files of program one and execute it. int main() { pid t
1. Type the following program and make sure you include the header files of program one and execute it. int main() { pid t pid: } /* fork another process */ printf (" In parent process, pid=%d ", getpid()); printf (" fork 1 invoked "); pid = fork(); if (pid == 0) {* child process */ printf (" child process id = %d ", getpid()); } printf (" fork 2 invoked "); pid = fork(); if (pid = 0) {* child process */ printf (" child process id = %d ", getpid()); } printf(" fork 3 invoked "); pid = fork(); if (pid = 0) { /* child process */ printf (" child process id = %d ", getpid()); } exit(0); Questions: What is the total number of processes? List the pid associated with each process.
Step by Step Solution
There are 3 Steps involved in it
To determine the total number of processes and list the associated process IDs PIDs lets analyze the ... View full answer
Get step-by-step solutions from verified subject matter experts
