in Operating System
1,360 views
1 vote
1 vote

The answer is given as 11. can anybody explain probably with a diagram?

in Operating System
1.4k views

2 Answers

1 vote
1 vote
if(!pid[k]) means we are entering the child process. On calling execvp() inside that process, that child process cannot call fork() on the next turn. Hence there are no exponential number of processes to consider. Therefore options c and d are elimintated.

The main process calls 10 forks each of which create one child each of which in turn call one execvp(). Hence the total number of processes created = 1 parent + 10 siblings = 11 processes created.

1 comment

System calls are not in gate syllabus right?
0
0
0 votes
0 votes

say for loop is executing k<=3, then picture will be this. isnot it?

1 comment

following !
0
0

Related questions