This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Consensus on MT-, AS- and AC-Safety docs.


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.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]