1.

In UNIX, the return value for the fork system call is _____ for the child process and _____ for the parent process.(a) A Negative integer, Zero(b) Zero, A Negative integer(c) Zero, A nonzero integer(d) A nonzero integer, ZeroThis question was posed to me in a national level competition.This question is from Process Creation in chapter Processes of Operating System

Answer»

Right option is (c) Zero, A NONZERO integer

The explanation is: In Unix, the RETURN value of the fork SYSTEM CALL is Zero for the child PROCESS and Non-zero value for parent process. A fork system call returns the PID of a newly created (child) process to the parent and returns Zero to that newly created (child) process.



Discussion

No Comment Found

Related InterviewSolutions