← Quiz: Processes and Threads: all 10 questions
Quiz: Processes and Threads · Question 6 of 10
What does fork() return in the child process?
What does fork() return in the child process?
- A.0
- B.The child's PID
- C.The parent's PID
- D.−1
Answer & explanation
Correct answer: 0
The parent receives the child's PID; the child receives 0. A return value of −1 means fork failed.
Can you get the rest right without peeking?
Take the timed Quiz: Processes and Threads quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →