Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Apr 1999 19:54:33 -0400 (EDT)
From:      Robert Watson <robert@cyrus.watson.org>
To:        hackers@freebsd.org
Subject:   child return in fork--question
Message-ID:  <Pine.BSF.3.96.990415195038.11607F-100000@fledge.watson.org>

next in thread | raw e-mail | index | archive | help

I'm playing around with process scheduling and doing funky things with
syscalls.  I notice that on i386, fork_return() hard codes the return
values from the fork syscall:

        frame.tf_eax = 0;  /* Child returns zero */
        frame.tf_eflags &= ~PSL_C;  /* success */
        frame.tf_edx = 1;
        userret(p, &frame, 0);                             

Most other places, we copy the p_retval[] fields out of the appropriate
process structure, rather than hard coding.  Is there a reason why the
same thing doesn't happen here, and p_retval[] be set in the child proc
structure in fork1()?  If not, if I submit patches, would they be put in?
(presumably the same code alpha-side would have to be done also).

I'd like to be able to make a machine independent change to the fork
return values in the fork code without munging into i386/alpha/etc code in
the future if I need to change it.

   Robert N Watson

robert@fledge.watson.org              http://www.watson.org/~robert/
PGP key fingerprint: 03 01 DD 8E 15 67 48 73  25 6D 10 FC EC 68 C1 1C

Carnegie Mellon University            http://www.cmu.edu/
TIS Labs at Network Associates, Inc.  http://www.tis.com/
Safeport Network Services             http://www.safeport.com/



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990415195038.11607F-100000>