diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-08-07 23:41:32 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-08-07 23:41:32 +0000 |
commit | cd65836b5fba2d34a4c04c15b47723ab9237b66a (patch) | |
tree | efa52e9d4a643e98d3771f19e45d94d5de62c147 /sysdeps/unix/sysv/linux/tile | |
parent | d9fee042e252b229f8f967bf36492c97ec112fa8 (diff) | |
download | glibc-cd65836b5fba2d34a4c04c15b47723ab9237b66a.tar.gz glibc-cd65836b5fba2d34a4c04c15b47723ab9237b66a.tar.xz glibc-cd65836b5fba2d34a4c04c15b47723ab9237b66a.zip |
Fix XPG4.2 bits/sigaction.h namespace (bug 21899).
For XPG4.2, sa_sigaction, SA_ONSTACK, SA_RESETHAND, SA_RESTART and SA_NODEFER should be defined in signal.h, but they are only defined for other standards at present. This patch fixes the various bits/sigaction.h headers accordingly. All the fixes are essentially the same, except those for SPARC and Tile. For SPARC, the header (a) spuriously defined various nonstandard macros for __USE_UNIX98 || defined __USE_XOPEN2K8 and (b) defined some standard macros as aliases of nonstandard ones instead of the other way round. This patch fixes the SPARC header to handle these macros the same way and with the same conditions as those for other architectures, so the standard macros are the primary ones and the other ones are defined only for __USE_MISC and are aliases of the standard ones where applicable. For Tile, the header spuriously defined the nonstandard macro SA_NOPTRACE for __USE_UNIX98 || defined __USE_XOPEN2K8; this is moved to __USE_MISC. (Those nonstandard macros are in a reserved namespace, but it seems desirable to be consistent between architectures as far as possible, and so not define them in standard modes anywhere.) Tested for x86_64, and with build-many-glibcs.py. [BZ #21899] * bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. Define directly rather than as alias. (SA_RESETHAND): Likewise. (SA_INTERRUPT): Define only for [__USE_MISC]. (SA_NOMASK): Define as alias of SA_NODEFER, only for [__USE_MISC]. (SA_ONESHOT): Define as alias of SA_RESETHAND, only for [__USE_MISC]. (SA_STACK): Define only for [__USE_MISC]. * sysdeps/unix/sysv/linux/tile/bits/sigaction.h (struct sigaction): Define sa_handler and sa_sigaction using union also for [__USE_XOPEN_EXTENDED]. (SA_ONSTACK): Change [__USE_UNIX98] condition to [__USE_XOPEN_EXTENDED]. (SA_RESTART): Likewise. (SA_NODEFER): Likewise. (SA_RESETHAND): Likewise. (SA_NOPTRACE): Define only for [__USE_MISC].
Diffstat (limited to 'sysdeps/unix/sysv/linux/tile')
-rw-r--r-- | sysdeps/unix/sysv/linux/tile/bits/sigaction.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/tile/bits/sigaction.h b/sysdeps/unix/sysv/linux/tile/bits/sigaction.h index 6b8c1d7de0..9f72698db5 100644 --- a/sysdeps/unix/sysv/linux/tile/bits/sigaction.h +++ b/sysdeps/unix/sysv/linux/tile/bits/sigaction.h @@ -24,7 +24,7 @@ struct sigaction { /* Signal handler. */ -#ifdef __USE_POSIX199309 +#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED union { /* Used if SA_SIGINFO is not set. */ @@ -54,17 +54,17 @@ struct sigaction #define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ #define SA_SIGINFO 4 /* Invoke signal-catching function with three arguments instead of one. */ -#if defined __USE_UNIX98 || defined __USE_MISC -# define SA_NOPTRACE 0x02000000 /* Don't ptrace this signal. */ +#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ #endif -#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ #endif #ifdef __USE_MISC +# define SA_NOPTRACE 0x02000000 /* Don't ptrace this signal. */ # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ /* Some aliases for the SA_ constants. */ |