1.

What is the value returned by fork system call, when the creation of child process is unsuccessful?(a) positive integer(b) negative integer(c) zero(d) fractional valueThe question was asked in unit test.My enquiry is from Process Status:ps Command and Phases of a Process in portion The Process of Unix

Answer»

Right choice is (b) negative integer

The best explanation: fork() system call is used in UNIX for creating NEW processes. It TAKES no parameters and returns an integer value. The value returned depends on the following cases:

Positive value: returned to the parent process. The value contains PID of child process which is created.

Negative value: returned if the creation of child process is unsuccessful.

Zero: returned to the NEWLY created child process.



Discussion

No Comment Found

Related InterviewSolutions