Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

----------------------------------- Figure 1 ------------------------------------------------ #include #include #include int main() { int fd; pid_t pid1=-1, pid2=-1; /* process-id */ switch(pid1 = fork()) { case -1: /*

image text in transcribed

----------------------------------- Figure 1 ------------------------------------------------

#include

#include

#include

int main()

{

int fd;

pid_t pid1=-1, pid2=-1; /* process-id */

switch(pid1 = fork()) {

case -1: /* error */

perror("fork failed");

break;

case 0:

break;

default:

switch(pid2 = fork()) {

case -1: /* error */

perror("fork failed");

break;

case 0:

break;

default:

} // end of switch(pid2 = ...

} // end of switch(pid1 = ...

} // end of main()

answer a - f and you will get thumbs up 100%

The template C code given in Figure 1 creates the following process architecture. Suppose that it created these 3 processes with their corresponding process ids. Provide the values of the variables, pid1 and pid2, when each process is about to terminate, and enter them into Blackboard "Final Exam Submission." (30 points) (a) For Parent, pid1 = ? (b) For Parent, pid2 = ? (c) For Child1, pid1 = ? (d) For Child1, pid2 = ? (e) For Child2, pid1 =

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions