System-Calls

Question 1
A process executes the code
fork();
fork();
fork();
The total number of child processes created is
A
3
B
4
C
7
D
8
       Operating-Systems       System-Calls       Gate 2012
Question 1 Explanation: 
The no. of child process created = 2n -1 = 23 -1 = 7 (where n is number of fork() statements)
7 are child processes.
Question 2
A process executes the following code for (i =0; i < n; i + +) for ( ); The total number of child processes created is  
A
n
B
(2n) - 1
C
2n
D
(2n+1) - 1
       Operating-Systems       System-Calls       Gate-2008
Question 2 Explanation: 
Fork is a system call, implements in kernel.
It is a operation where process creates a copy of itself.

1,3,7,15,31,... ⇒ 2n-1
Question 3
Consider the following code fragment:
  if (fork() == 0)
  { a = a + 5; printf(“%d,%dn”, a, &a); }
  else { a = a –5; printf(“%d, %dn”, a, &a); }
Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
A
u = x + 10 and v = y
B
u = x + 10 and v is ≠ y
C
u + 10 = x and v = y
D
u + 10 = x and v ≠ y
       Operating-Systems       System-Calls       Gate-2005
Question 3 Explanation: 
u, v values printed by parent process.
u=a-5; v be address of a
a=u+5;
x, y values printed by child process.
x=a+5; y be the address of a
x=u+5+5; v=y
x=u+10
Question 4
System calls are usually invoked by using
A
a software interrupt
B
polling
C
an indirect jump
D
a privileged instruction
       Operating-Systems       System-Calls       Gate-1999
Question 4 Explanation: 
Software interrupts are implementing device drivers (or) transitions between protected mode of operations, such as system calls.
There are 4 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com