bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sigaction, SA_SIGINFO, and SIG_IGN


From: Bruno Haible
Subject: Re: sigaction, SA_SIGINFO, and SIG_IGN
Date: Fri, 20 Jun 2008 01:43:40 +0200
User-agent: KMail/1.5.4

Paul Eggert wrote:
> I'd feel a bit safer if we wrote the code to conform to POSIX rather
> than assume the typical implementation where sa_handler and
> sa_sigaction overlap.

Sorry, I can't follow the argumentation. The set of systems where
sa_handler and sa_sigaction are disjoint is empty, and you make assumptions
how these systems will likely behave. Since such systems don't exist, it
is speculation. You base your speculation on POSIX, but the case we are
discussing is when the application does not obey POSIX and the system does
not detect it. How do you want to use POSIX as an argument here?

>  How about something like this instead?
>
>   if (sigaction (fatal_signals[i], NULL, &action) == 0
>       && ((action.sa_flags & SA_SIGINFO
>          ? (void (*) (int)) action.sa_sigaction
>          : action.sa_handler)
>           == SIG_IGN))
>     fatal_signals[i] = -1;

This will not compile on Interix 3.5, whereas the current code does.
And while Interix is not POSIX conformant, it is an existing system.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]