[Top][All Lists]

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

bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionall

From: Eric Blake
Subject: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally
Date: Fri, 15 Jul 2011 06:55:35 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

On 07/15/2011 04:28 AM, Pádraig Brady wrote:
> On 15/07/11 08:50, Paul Eggert wrote:
>> On 07/14/11 17:25, Pádraig Brady wrote:
>>> I'm not sure about defining these to 0 in gnulib.
>>> That will silently ignore the intent of a program on certain platforms.

> Absolutely. What I was getting was that it's probably better to leave
> the following to the app too:
> #ifndef SA_RESETHAND
> # define SA_RESETHAND 0
> /* Now the app writer knows they need to handle this case */
> #endif

Can't the gnulib sigaction module be taught to fake SA_RESETHAND, by
wrapping the user's signal-handler inside a gnulib shim, where the shim
resets signals correctly before calling the user's handler?  Granted,
it's not trivial, but I think that it is still within the realm of
technical possibilities.  At which point, SA_RESETHAND would always be
non-zero once you use the gnulib <signal.h>.

>> On NonStop, if you invoke signal(), it uses the SA_RESETHAND semantics
>> (POSIX allows this).  Conversely, if you invoke sigaction(), NonStop
>> always behaves as if SA_RESTART and SA_RESETHAND are zero, i.e., it
>> doesn't support either feature with sigaction.
> Thanks for checking that.

Seems like there's some room for improvement in the gnulib sigaction
module then.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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