Forking Process in Unix - Quiz Explanation


The correct answers are indicated below, along with text that explains the correct answers.
1. Which of the following describes an interactive process?
Please select the best answer.
  A. A process that runs in the background to carry out infrastructure duties
  B. A process that is started and stopped by user commands to carry out specific tasks
  C. A process that takes input and generates output in response to human interaction
  D. A process that is not associated with any terminal and is dedicated to handling a particular task
  The correct answer is C. The most important type of interactive process is a shell program. Other types of processes include background processes and user-command-activated processes. A daemon is a type of background process that is not associated with any terminal and is dedicated to handling a particular task.
2. What does the fork() system call do?
Please select the best answer.
  A. Starts a new process that replaces whatever process called the new process
  B. Asks the operating system to clone whatever process calls it
  C. Waits for a process to terminate
  D. Reads a specified list of files and generates output for human use
  The correct answer is B. The exec() system call starts a new process that replaces whatever process called the new process. The wait() system call waits for a process to terminate. The grep command reads a specified list of files and generates output for human use.
3. A daemon is a process that
Please select the best answer.
  A. Reads files and generates human-readable output
  B. Is not associated with any terminal and handles a particular task
  C. Is associated with a particular terminal device
  D. Starts a new login shell process for a specific user
  The correct answer is B. Daemon processes run the print queue and handle network infrastructure tasks.