From owner-freebsd-hackers Wed Jan 12 7: 3: 7 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp02.mrf.mail.rcn.net (smtp02.mrf.mail.rcn.net [207.172.4.61]) by hub.freebsd.org (Postfix) with ESMTP id AE42514C32 for ; Wed, 12 Jan 2000 07:03:05 -0800 (PST) (envelope-from archer@lucky.net) Received: from 207-172-82-152.s25.as6.xnb.nj.dialup.rcn.com ([207.172.82.152] helo=unknown.nowhere.org) by smtp02.mrf.mail.rcn.net with esmtp (Exim 2.12 #3) id 128PId-0000hX-00 for hackers@freebsd.org; Wed, 12 Jan 2000 10:03:03 -0500 Received: (from archer@localhost) by unknown.nowhere.org (8.9.3/8.9.3) id JAA12686; Wed, 12 Jan 2000 09:33:50 -0500 (EST) (envelope-from archer) Date: Wed, 12 Jan 2000 09:33:50 -0500 (EST) Message-Id: <200001121433.JAA12686@unknown.nowhere.org> From: Alexander Litvin To: hackers@freebsd.org Subject: Re: rfork() [was: Concept check] X-Newsgroups: unknown.freebsd.hackers In-Reply-To: <200001120556.VAA67332@apollo.backplane.com> User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (FreeBSD/4.0-CURRENT (i386)) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: > :BTW, concerning rfork(RFMEM). Could somebody explain me, why the > :following simple program is coredumping: > You cannot call rfork() with RFMEM directly from a C program. You > have to use assembly (has anyone created a native clone() call yet > to do all the hard work?). > The reason is that rfork(RFMEM) does not give the new process a new > stack, so both the old and new processes wind up on the same original > stack and stomp all over each other. Oh, well, I suspected something like that (from what I saw, trying to debug that small piece of code). Should it be at least mentioned in rfork(2)? --- You are only young once, but you can stay immature indefinitely. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message