From owner-freebsd-hackers Wed Aug 19 07:42:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA21529 for freebsd-hackers-outgoing; Wed, 19 Aug 1998 07:42:57 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bright.fx.genx.net (bright.fx.genx.net [206.64.4.154]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA21513 for ; Wed, 19 Aug 1998 07:42:51 -0700 (PDT) (envelope-from bright@www.hotjobs.com) Received: from localhost (bright@localhost) by bright.fx.genx.net (8.9.1/8.8.8) with SMTP id KAA19373 for ; Wed, 19 Aug 1998 10:43:09 -0500 (EST) (envelope-from bright@hotjobs.com) X-Authentication-Warning: bright.fx.genx.net: bright owned process doing -bs Date: Wed, 19 Aug 1998 10:43:09 -0500 (EST) From: Alfred Perlstein X-Sender: bright@bright.fx.genx.net To: hackers@FreeBSD.ORG Subject: sfork()? In-Reply-To: <199808191303.PAA10187@sos.freebsd.dk> 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 can someone explain why this doesn't work? (the child process just segfaults, even without the printfs) ----- CUT #include #include volatile int t=0; int main(void){ pid_t pid; if(pid = rfork(RFPROC | RFMEM)){ printf("(parent)pid = %d\n",pid); while(1){ printf("%d\n",t); sleep(1); } } else { printf("doesn't die here..."); t = 1; printf("changed t... "); sleep(10000); } printf("pid = %d about to exit\n",pid); return(0); } ----- END Alfred Perlstein - Programmer, HotJobs Inc. - www.hotjobs.com -- There are operating systems, and then there's BSD. -- http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message