From owner-freebsd-hackers Mon Jul 17 01:00:33 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id BAA11162 for hackers-outgoing; Mon, 17 Jul 1995 01:00:33 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id BAA11154 for ; Mon, 17 Jul 1995 01:00:28 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA27171; Mon, 17 Jul 1995 09:53:41 +0200 Received: by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id JAA07971; Mon, 17 Jul 1995 09:53:31 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id JAA05076; Mon, 17 Jul 1995 09:21:45 +0200 From: J Wunsch Message-Id: <199507170721.JAA05076@uriah.heep.sax.de> Subject: Re: Ignoring SIGCHLD without having to wait()? To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Mon, 17 Jul 1995 09:21:44 +0200 (MET DST) Cc: filo@yahoo.com Reply-To: freebsd-hackers@freebsd.org (FreeBSD hackers) In-Reply-To: <9507170445.AA18374@cs.weber.edu> from "Terry Lambert" at Jul 16, 95 10:45:38 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1627 Sender: hackers-owner@freebsd.org Precedence: bulk As Terry Lambert wrote: > > I believe that the "ignore" is supposed to work: that is, it will cause > the exit status to be automatically reaped. That is, _exit will check > the mask on the parent process and react accordingly. Huh? j@uriah 88% cat foo.c #include #include #include #include int main(void) { pid_t pid; int i; signal(SIGCHLD, SIG_IGN); for(i = 0; i < 20; i++) { if((pid = fork()) == 0) { return 0; } } sleep(100); return 0; } j@uriah 89% cc foo.c j@uriah 90% ./a.out & [2] 5031 j@uriah 91% ps PID TT STAT TIME COMMAND ... 5031 a1 S 0:00.10 ./a.out 5032 a1 Z 0:00.00 (a.out) 5033 a1 Z 0:00.00 (a.out) 5034 a1 Z 0:00.00 (a.out) 5035 a1 Z 0:00.00 (a.out) 5036 a1 Z 0:00.00 (a.out) 5037 a1 Z 0:00.00 (a.out) 5038 a1 Z 0:00.00 (a.out) 5039 a1 Z 0:00.00 (a.out) 5040 a1 Z 0:00.00 (a.out) 5041 a1 Z 0:00.00 (a.out) 5042 a1 Z 0:00.00 (a.out) 5043 a1 Z 0:00.00 (a.out) 5044 a1 Z 0:00.00 (a.out) 5045 a1 Z 0:00.00 (a.out) 5046 a1 Z 0:00.00 (a.out) 5047 a1 Z 0:00.00 (a.out) 5048 a1 Z 0:00.00 (a.out) 5049 a1 Z 0:00.00 (a.out) 5050 a1 Z 0:00.00 (a.out) 5051 a1 Z 0:00.00 (a.out) j@uriah 92% kill %2 [2] Terminated ./a.out -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)