This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Consensus on MT-, AS- and AC-Safety docs.
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, Rich Felker <dalias at aerifal dot cx>, Torvald Riegel <triegel at redhat dot com>
- Date: Mon, 25 Nov 2013 17:38:39 -0200
- Subject: Re: Consensus on MT-, AS- and AC-Safety docs.
- Authentication-results: sourceware.org; auth=none
- References: <528A7C8F dot 8060805 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1311182312130 dot 8831 at digraph dot polyomino dot org dot uk> <528BA2DA dot 3090608 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1311192205550 dot 8742 at digraph dot polyomino dot org dot uk> <orppprqmyz dot fsf at livre dot home> <Pine dot LNX dot 4 dot 64 dot 1311251753500 dot 12149 at digraph dot polyomino dot org dot uk>
On Nov 25, 2013, "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Sat, 23 Nov 2013, Alexandre Oliva wrote:
>> I wonder if we should have a future-proof API for signal handlers to
>> call in order to save local state that AS-Safe libc functions may call
>> and that should be preserved by signal handlers. Something like:
>>
>> #define sigsavestate() do { sigsave_t __sigsaved = { errno };
>> #define sigreststate() errno = __sigsaved.err_no; } while (0)
>>
>> Maybe with pthread cleanup around it too. Note that I left the fp env
>> out of the initializer in this generic fallback definition, for only on
>> a few platforms does it have to be saved; those would override the
>> header that defines the sigsave_t type and the macros.
> Most signal handlers are much more likely to use e.g. write () than
> anything involving floating point, so it wouldn't be appropriate to have a
> generic API that deals with floating-point state when most handlers don't
> need it.
The proposed macros could take a constant bitmask indicating the
portions of state that might need to be preserved.
This is all assuming that your remark about preserving errno and fenv is
relevant. If it's not, as you seem to imply in your quoted paragraph,
then the macros definitely aren't.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer