This set of Operating System Multiple Choice Questions & Answers (MCQs) focuses on “The Fork and exec System Calls”.
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
View Answer
Explanation: None.
2. 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
View Answer
Explanation: None.
3. Which of the following system calls transforms executable binary file into a process?
a) fork
b) exec
c) ioctl
d) longjmp
View Answer
Explanation: None.
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
View Answer
Explanation: None.
5. Which of the following calls never returns an error?
a) getpid
b) fork
c) ioctl
d) open
View Answer
Explanation: None.
6. 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
View Answer
Explanation: None.
7. 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
View Answer
Explanation: None.
8. 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
View Answer
Explanation: None.
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
View Answer
Explanation: The new process is purely based on fork, due to no exec command, duplication will be done.
Sanfoundry Global Education & Learning Series – Operating System.
To practice all areas of Operating System, here is complete set on 1000+ Multiple Choice Questions and Answers on Operating System.
- Check Computer Science Books
- Practice BCA MCQs
- Practice Computer Science MCQs
- Check Operating System Books
- Apply for Computer Science Internship