GNU bug report logs - #9076
coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

Previous Next

Package: coreutils;

Reported by: "Joachim Schmitz" <jojo <at> schmitz-digital.de>

Date: Thu, 14 Jul 2011 06:56:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: Joachim Schmitz <jojo <at> schmitz-digital.de>, 9076 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>, Bug-gnulib <bug-gnulib <at> gnu.org>
Subject: bug#9076: coreutils-8.12 uses SA_RESETHAND and	SA_RESTART	unconditionally
Date: Fri, 15 Jul 2011 06:55:35 -0600
[Message part 1 (text/plain, inline)]
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   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 13 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.