Commit Graph

12 Commits

Author SHA1 Message Date
Rich Felker 5c5e45e58b move signal.h REG_* macros under _GNU_SOURCE protection
they were accidentally exposed under just baseline POSIX, which is a
big namespace pollution issue. thankfully glibc only exposes them
under _GNU_SOURCE, not under any of its other options, so omitting
the pollution in the default _BSD_SOURCE profile does not hurt
application compatibility at all.
2012-12-06 17:05:19 -05:00
rofl0r a631c5df53 bits/signal.h: add register names for x86(_64)
glibc exposes them from ucontext.h.
since that header includes signal.h, it is safe to put them
into bits/signal.h, if _GNU_SOURCE is defined.
2012-12-06 18:14:49 +01:00
Rich Felker a8da6c2f28 fixup mcontext stuff to expost gregset_t/fpregset_t as appropriate 2012-11-25 23:04:23 -05:00
Rich Felker c72fc23843 sigcontext/mcontext cleanup for arch-specific bits
with these changes, the members/types of mcontext_t and related stuff
should closely match the glibc definitions. unlike glibc, however, the
definitions here avoid using typedefs as much as possible and work
directly with the underlying types, to minimize namespace pollution
from signal.h in the default (_BSD_SOURCE) profile.

this is a first step in improving compatibility with applications
which poke at context/register information -- mainly debuggers, trace
utilities, etc. additional definitions in ucontext.h and other headers
may be needed later.

if feature test macros are used to request a conforming namespace,
mcontext_t is replaced with an opaque structure of the equivalent size
and alignment; conforming programs cannot examine its contents anyway.
2012-11-23 14:35:25 -05:00
Rich Felker 7538708f8b fix up leftover, incorrect NSIG definitions in arch-specific signal.h 2012-11-23 12:20:53 -05:00
Rich Felker 65b98213e4 add back NSIG, removed from powerpc in last commit, but for all archs
unlike the previous definition, NSIG/_NSIG is supposed to be one more
than the highest signal number. adding this will allow simplifying
libc-internal code that makes signal-related syscalls, which can be
done as a later step. some apps might use it too; while this usage is
questionable, it's at least not insane.
2012-11-21 13:41:58 -05:00
Rich Felker 030b452b8d fix missing _BSD_SOURCE support in bits/*.h
this is actually rather ugly, and would get even uglier if we ever
want to support further feature test macros. at some point i may
factor the bits headers into separate files for C base, POSIX base,
and nonstandard extensions (the only distinctions that seem to matter
now) and then the logic for which to include can go in the main header
rather than being duplicated for each arch. the downside of this is
that it would result in more files having to be opened during
compilation, so as long as the ugliness does not grow, i'm inclined to
leave it alone for now.
2012-05-22 22:12:10 -04:00
Rich Felker f780ac5baf cleanup redundancy in bits/signal.h versions 2011-09-19 20:02:12 -04:00
Rich Felker 6871fd773d make sigaltstack work (missing macros in signal.h, error conditions) 2011-03-10 10:17:29 -05:00
Rich Felker 8668f033bc fill in some missing siginfo stuff in signal.h 2011-02-20 01:26:25 -05:00
Rich Felker ad2fe25041 support the ugly and deprecated ucontext and sigcontext header stuff...
only the structures, not the functions from ucontext.h, are supported
at this point. the main goal of this commit is to make modern gcc with
dwarf2 unwinding build without errors.

honestly, it probably doesn't matter how we define these as long as
they have members with the right names to prevent errors while
compiling libgcc. the only time they will be used is for propagating
exceptions across signal-handler boundaries, which invokes undefined
behavior anyway. but as-is, they're probably correct and may be useful
to various low-level applications dealing with virtualization, jit
code generation, and so on...
2011-02-18 22:03:03 -05:00
Rich Felker 1355fdca7c preparing build system to handle ports - step 1 2011-02-15 00:33:23 -05:00