Date: Tue, 12 Jun 2001 09:38:24 -0700 (PDT) From: Matt Dillon <dillon@earth.backplane.com> To: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz> Cc: David Malone <dwmalone@maths.tcd.ie>, Peter Wemm <peter@wemm.org>, Terry Lambert <tlambert2@mindspring.com>, hackers@FreeBSD.ORG Subject: Re: signal(SIGCHLD, SIG_IGN) patch solving SUSv2 compatibility issue Message-ID: <200106121638.f5CGcOo42940@earth.backplane.com> References: <200106101845.f5AIje014790@earth.backplane.com> <20010611002050.362CE380E@overcee.netplex.com.au> <20010611115806.A53216@walton.maths.tcd.ie> <20010612095323.A72009@dcse.fee.vutbr.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
: :David Malone wrote (2001/06/11): :> On Sun, Jun 10, 2001 at 05:20:50PM -0700, Peter Wemm wrote: :> > 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've committed this - I'll let Matt do the MFC when he feels ready. : :Thanks for this commit, but it works exactly in the way, which :I wanted to avoid. It is something like "partially submitted and :not approved by me". Please, could you look once again on it? :Please please please... Thanks. ;-) : :- Hunk #1 from commit adds PS_NOCLDWAIT when SIG_IGN is used for : SIGCHLD, so if I use : sigemptyset(&sa.sa_mask); : sa.sa_flags = 0; : sa.sa_handler = SIG_IGN; : sigaction(SIGCHLD, &sa, NULL); : sigaction(SIGCHLD, NULL, &so); : I get additional flag SA_NOCLDWAIT in so.sa_flags. None of tested : systems (Solaris, Unixware, Irix, Linux, Aix) works in this way. :- If hunk #1 is applied, I see hunk #2 (resetting SIG_IGN to SIG_DFL : for SIGCHLD) as almost unnecessary, because it is just cosmetic : change now and behavior in exec() is very different among various : systems. You have to remain consistent, otherwise the exec'd program might set a signal handler and then restore the original and suddenly it works differently. :- (And I have found another bug in my original patch. Three code lines : and two bad bugs... :-( :-) : :Here are patches for current -current (... which I had to do in the :first posting). These should change the behavior as is in Solaris, :where flags are not added and SIGCHLD is resetted to SIG_DFL after an :exec(). I'm testing these patches on my -stable production backup :server running amanda and up to now without any problem. : Your patches look pretty good. Personally I don't think having the SA_NOCLDWAIT flag show up is a big deal since programs which use SIG_IGN do not generally know the flag even exists, but I do agree that we might as well make the interface as compatible as possible. I'll take a look at them tonight and (unless Dave wants to) I'll commit an update to -current and hold off the -stable MFC another few days. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106121638.f5CGcOo42940>