Question 178Asked in DSSSB TGT Computer Science, 25 Jun 2023, Shift 3 (4:30 PM)

Fork() returns a negative value when ______.

Fork() returns a negative value when ______.
  1. Acreation of a child process was unsuccessful
  2. Breturned to parent or caller
  3. Creturned to the newly created child process
  4. 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.

From DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 3 (4:30 PM)

This is question 178 of DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 3 (4:30 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.