Question: Select ALL that apply. Assume all the proper #includes and declarations have been made, and that all system calls execute without error. The size of
Select ALL that apply. Assume all the proper #includes and declarations have been made, and that all system calls execute without error. The size of an pidt variable is bytes and the size of an integer is bytes for this system. Based on the snippet below THIS IS PSEUDOCODE answer the following questions MULTIPLE ANSWERS:
int pipefd;
pidt res;
int r r r r r;
pipepipefd;
res fork;
if res
r writepipefd&res,sizeofr;
sleep;
r writepipefd&res,sizeofchar;
printfFinished;
closepipefd;
else if res
closepipefd;
r readpipefd&r sizeofr;
r readpipefd&rsizeofr;
r readpipefd&rsizeofchar;
sleep;
r readpipefd&rsizeofr;
exit;
Group of answer choices
Possible case for values r r r are: positive,
Possible case for values r r r are: positive,
If somehow we manage to go past the second sys call in the child, then the third sys call is blocking;
If we delete the first sys call read in the child, then the third sys call read blocks and r;
The second sys call read for the child is blocking because the child waits to read more bytes than what was written in the pipe.
The second sys call read for the child is unsuccessful because the argument size is not correct.
If somehow we manage to go past the third sys call in the child, then the fourth sys call is blocking
If we delete the second sys call in the child, then the fourth syscall read returns with r
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
