Operating System MCQ and Answers – The fork and exec System Calls

These Operating System MCQ and Answers – The fork and exec System Calls are asked in various examinations including BCA, MCA, GATE, and other tests. The questions based on the below Operating System MCQ and Answers – The fork and exec System Calls test your basic knowledge of MCQs on the topic of Operating Systems and the level of comprehension and grasp that you hold.

Operating System MCQ and Answers – The fork and exec System Calls

1. Which of the following calls never returns an error?

a) getpid

b) fork

c) ioctl

d) open

Answer: a

2. 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: b

3. 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: b

4. 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: a

5. 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: b

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

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

a) fork

b) exec

c) ioctl

d) longjmp

Answer: b

Comments