fork() is returning > 0 ???

Doug Gwyn gwyn at smoke.brl.mil
Sat Nov 10 16:32:02 AEST 1990


In article <2691 at ux.acs.umn.edu> eric at ux.acs.umn.edu (Merlinus Ambrosius) writes:
>Can you explain why in this piece of code, fork() is returning a value
>other than -1 or 0?

Because fork() returns:
	-1		if unable to create another process
	0		in the newly created process branch
	the process id	of the new process, in the parent branch

By the way, this is a UNIX-specific question, not a C language question.

>... any ideas on what could be going on here would be wonderful.

I would think they would be necessary.



More information about the Comp.lang.c mailing list