From owner-freebsd-hackers Thu Apr 15 16:56:58 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 6651814A2F for ; Thu, 15 Apr 1999 16:56:56 -0700 (PDT) (envelope-from robert@cyrus.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.8.8/8.8.8) with SMTP id TAA13532 for ; Thu, 15 Apr 1999 19:54:34 -0400 (EDT) (envelope-from robert@cyrus.watson.org) Date: Thu, 15 Apr 1999 19:54:33 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org Reply-To: Robert Watson To: hackers@freebsd.org Subject: child return in fork--question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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