The fork and exec System Calls MCQ’s

Read Time:1 Minute, 33 Second

This set of Operating System Multiple Choice Questions & Answers (MCQs) focuses on “The fork and exec System Calls”.

1. The following program results in the creation of?

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

a) an orphan process
b) a zombie process
c) a process that executes forever
d) none of the mentioned

2. Which of the following system calls transforms executable binary file into a process?
a) fork
b) exec
c) ioctl
d) longjmp

3. Which of the following system calls does not return control to the calling point, on termination?
a) fork
b) exec
c) ioctl
d) longjmp

4. How many times the following C program prints yes?

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

a) only once
b) twice
c) four times
d) eight 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

6. 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

7. Which of the following calls never returns an error?
a) getpid
b) fork
c) ioctl
d) open

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

9. 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

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post Multi Threading Models MCQ’s
Next post Thread Cancellation MCQ’s