SSC Multi-Tasking Non-Technical Staff Model Exams in Telugu

AP Grama Sachivalayam 2023 Free Test Series in Telugu (14,523 Vacancies)

Digital Assistant 2023 PART B - 100 Marks All Topics MCQs

The Fork and exec System Calls - Operating System Questions & Answers

1.

Which of the following system calls does not return control to the calling point, on termination?

   A.) fork
   B.) exec
   C.) ioctl
   D.) longjmp

Answer: Option 'B'

exec

2.

The following program:

   main()
   {
      if(fork()>0)
      sleep(100);
   }

results in the creation of:

   A.) an orphan process
   B.) a zombie process
   C.) a process that executes forever
   D.) none of the mentioned

Answer: Option 'B'

a zombie process

3.

Which of the following system calls transforms executable binary file into a process?

   A.) fork
   B.) exec
   C.) ioctl
   D.) longjmp

Answer: Option 'B'

exec

4.

The following C program :

 main()
   {
     fork();fork();printf("yes");
   }
   prints yes:

   A.) only once
   B.) twice
   C.) four times
   D.) eight times

Answer: Option 'C'

four times

5.

A fork system call will fail if :

   A.) the previously executed statement is also a fork call
   B.) the limit on the maximum number of processes in the system would be executed
   C.) the limit on the minimum number of processes that can be under execution by a single user would be executed
   D.) all of the mentioned

Answer: Option 'B'

the limit on the maximum number of processes in the system would be executed

6.

Which of the following calls never returns an error?

   A.) fork
   B.) getpid
   C.) ioctl
   D.) open

Answer: Option 'B'

getpid

7.

If a process does not call exec after forking,

   A.) the program specified in the parameter to exec will replace the entire process
   B.) all the threads should be duplicated
   C.) all the threads should not be duplicated
   D.) none of the mentioned

Answer: Option 'B'

all the threads should be duplicated

8.

If a thread invokes the exec system call,

   A.) only the exec executes as a separate process.
   B.) the program specified in the parameter to exec will replace the entire process
   C.) the exec is ignored as it is invoked by a thread.
   D.) none of the mentioned

Answer: Option 'B'

the program specified in the parameter to exec will replace the entire process

9.

If exec is called immediately after forking,

   A.) the program specified in the parameter to exec will replace the entire process
   B.) all the threads will be duplicated
   C.) all the threads may be duplicated
   D.) none of the mentioned

Answer: Option 'A'

the program specified in the parameter to exec will replace the entire process


The Fork and exec System Calls - Operating System Questions & Answers Download Pdf

Recent Posts