On Thu, Aug 26, 1999 at 10:40:29AM -0400, Andrew Gallatin wrote:
[...]
> Specifically, when a linux/alpha process forks, the child's return
> value is the parent's pid rather than zero.
[...]
> If I run the following code on FreeBSD/i386, I see:
> parent's pid = 6730
> I am the child, result = 0
> I must be the parent, result = 6731
> 
> Whereas FreeBSD/alpha does this:
> 
> parent's pid = 17721
> I must be the parent, result = 17721
> I must be the parent, result = 17722

The Single Unix Specification says about this:

  RETURN VALUE

      Upon successful completion, vfork()  returns 0 to the child
      process and returns the process  ID of the child process to
      the  parent  process.  Otherwise,  -1 is  returned  to  the
      parent, no  child process is  created, and errno is  set to
      indicate the error.

Returning the PPID for the child would break many sources, as
you already said.

  Björn

-- 
-----BEGIN GEEK CODE BLOCK-----
GCS d--(+) s++: a- C+++(-) UB++++OSI++++$ P+++(-) L+++(--) !E W- N+ o>+
K- !w !O !M !V  PS++  PE-  PGP++  t+++  !5 X++ tv- b+++ D++ G e+ h-- y+ 
------END GEEK CODE BLOCK------


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to