Question 178Asked in DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)Fork() returns a negative value when ______.
- Acreation of a child process was unsuccessful
- Breturned to parent or caller
- Creturned to the newly created child process
- Dcreation of a child process was successful
Show answerHide answer
Correct answer: (A) creation of a child process was unsuccessful
Explanation
fork() returns −1 if creating the child fails. It returns 0 in the child, and the child's PID in the parent.