IC221: Systems Programming12-Week Written ExamApril 2, 2014Answer the questions in the spaces provided on the question sheets. If you run out of roomfor an answer, continue on the back of the page. Show all work, but please be legible.Microscopic writing will not be graded.You are allowed a single crib sheet for this exam on an 8.5"x11" sheet ofpaper, hand written. You must turn in your crib sheet
...[Show More]
IC221: Systems Programming
12-Week Written Exam
April 2, 2014
Answer the questions in the spaces provided on the question sheets. If you run out of room
for an answer, continue on the back of the page. Show all work, but please be legible.
Microscopic writing will not be graded.
You are allowed a single crib sheet for this exam on an 8.5"x11" sheet of
paper, hand written. You must turn in your crib sheet with your exam.
Name:
Section:
Alpha:
Question | Points | Score
1 | 15
2 | 15
3 | 15
4 | 15
5 | 15
Total: | 75
IC221 12-Week Written Exam April 2, 2014
1. Consider the following program:
int main (){
int i, status ;
for (i =0;i <3; i ++){
if( fork () == 0){
/* child */
printf (" Child : %d: Hello World !", i);
_Exit (0);
} else {
/* parent */
printf (" Parent : %d: Hello World !\n",i);
}
}
wait (& status );
if( WIFSIGNALED ( status )){
printf (" Process signaled \n");
}
return 0;
}
(a) [4 points] To the right of the program, complete the drawing of the process tree above,
where each dot represents a process and a fork results in a split, up for the parent and down for the
child. Below answer: How many total processes are created, including the initial parent process?
How many total processes are running after the loop? Explain
[Show Less]