From owner-freebsd-hackers Sun Jun 10 17:20:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id 69BED37B401 for ; Sun, 10 Jun 2001 17:20:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f5B0KoM70474 for ; Sun, 10 Jun 2001 17:20:50 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 362CE380E; Sun, 10 Jun 2001 17:20:50 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Matt Dillon Cc: Cejka Rudolf , David Malone , Terry Lambert , hackers@FreeBSD.ORG Subject: Re: signal(SIGCHLD, SIG_IGN) patch solving SUSv2 compatibility issue In-Reply-To: <200106101845.f5AIje014790@earth.backplane.com> Date: Sun, 10 Jun 2001 17:20:50 -0700 From: Peter Wemm Message-Id: <20010611002050.362CE380E@overcee.netplex.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matt Dillon wrote: > > :... > : > :sigemptyset(&sa.sa_mask); > :sa.sa_flags = 0; > :sa.sa_handler = SIG_IGN; > :sigaction(SIGCHLD, &sa, NULL); > : > :zombies are still created in FreeBSD, which is against SUSv2. > : > :My citation was quoted directly from sigaction() page and not > :from signal() page. Unfortunately, I do not have access to POSIX, > :so I do not know if it is specified in SUSv2 only or if it is > :specified in both SUSv2 and in POSIX. I'm afraid that it is in both. > :However I think, that FreeBSD wants to be SUSv2 compliant too, or not? > :... > > I did some research and while I couldn't find the official POSIX > spec, I did read the SUSv2 spec carefully and I looked at a lot of > manual pages. > > I believe your change is correct. We should disable zombie reaping > if SIGCHLD is set to SIG_IGN. This is, in fact, how most systems do > it. BSD is like the sickly child in some respects :-) > > Your (revised) patch, which I have reproduced below along with a > little cleanup, looks correct. I compiled up a kernel with the > revised patch and tested it, and it seems to work as advertised. > > I would say this should go into -current now. I would be happy to > do this, or David Malone can since he provided the fix to the original > patch. I agree totally. This should have been done ages ago, I've been burned on it a few times, but never badly enough to go fix it. > I would also recommend that we MFC the patch to -stable after a few days. > It is highly unlikely to break anything. I suppose I could take the > heat for that :-) Every major forking program I've ever written has had > to set the sigaction flag *AND* set the signal handle to SIG_IGN to be > portable, and while I probably won't stop, it would be nice to know that > FreeBSD works both ways. Yes. > -Matt Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message