From owner-freebsd-current Sun Mar 21 10: 2:58 1999 Delivered-To: freebsd-current@freebsd.org Received: from zone.syracuse.net (zone.syracuse.net [209.2.141.6]) by hub.freebsd.org (Postfix) with ESMTP id 7FA2B15175; Sun, 21 Mar 1999 10:02:56 -0800 (PST) (envelope-from green@unixhelp.org) Received: from localhost (green@localhost) by zone.syracuse.net (8.9.2/8.9.2) with ESMTP id SAA02843; Sun, 21 Mar 1999 18:02:03 GMT (envelope-from green@unixhelp.org) Date: Sun, 21 Mar 1999 18:02:02 +0000 (GMT) From: Brian Feldman X-Sender: green@zone.syracuse.net To: Matthew Dillon Cc: Alfred Perlstein , "John S. Dyson" , samit@usa.ltindia.com, commiters@FreeBSD.ORG, freebsd-current@FreeBSD.ORG Subject: Re: rfork() In-Reply-To: <199903211721.JAA13495@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 21 Mar 1999, Matthew Dillon wrote: > :Hence the NEW flag RFSTACK. Why would this be a bad thing? This would keep > :the old behavior and allow much nicer new behavior. I didn't suggest > :changing the old behavior. This would just greatly simplify things so all of > > I think Richard Seaman has it right: the stack needs to be passed. > > Why don't we simply implement the linux clone()? It sounds to me that > it would be trivial. Let's add another parameter to fork1/rfork(): pid_t rfork __P((int, ...)); for userland struct rfork_args { int flags; caddr_t extra; }; and in the kernel would be: fork1(p1, flags) register struct proc *p1; int flags; caddr_t extra; { foo } We, of course, have backward binary and code compatibility outside of the kernel with the ellipses, and inside the kernel we control it anyway so we can modify whatever needs to be changed. > > :the assembly wouldn't be needed. Hmm... actually... if one were to mmap() a > :stack and as soon as the rfork() returned movl newstack,%esp and whatnot, > :wouldn't this be a pretty simple solution? > > No, because one of the processes may overrun the stack before the other > one managed to return from rfork(). The child process cannot use the > old stack at all. Why would a simple movl be using the stack? > > Matthew Dillon > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > Brian Feldman _ __ ___ ___ ___ green@unixhelp.org _ __ ___ | _ ) __| \ http://www.freebsd.org/ _ __ ___ ____ | _ \__ \ |) | FreeBSD: The Power to Serve! _ __ ___ ____ _____ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message