diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-01-22 14:44:29 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-01-22 14:44:29 +0000 |
commit | fa6e328b05204fa7872858517e1a43cfd90aa8d2 (patch) | |
tree | 436f49ce17b9f700c991eddd1228bbaaf0b67fb2 /libc/sysdeps/linux/common | |
parent | 6f8832e0dec5fc1086241e7e381a0920fcf4c8b6 (diff) | |
download | uClibc-alpine-fa6e328b05204fa7872858517e1a43cfd90aa8d2.tar.bz2 uClibc-alpine-fa6e328b05204fa7872858517e1a43cfd90aa8d2.tar.xz |
Synch whole signal handling rework with trunk. Tested on nptl-sh4.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r-- | libc/sysdeps/linux/common/__syscall_rt_sigaction.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/kernel_sigaction.h | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/sigaction.h | 42 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/sigset.h | 25 |
4 files changed, 40 insertions, 35 deletions
diff --git a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c index c3246b1bf..006b38a2a 100644 --- a/libc/sysdeps/linux/common/__syscall_rt_sigaction.c +++ b/libc/sysdeps/linux/common/__syscall_rt_sigaction.c @@ -11,7 +11,9 @@ #ifdef __NR_rt_sigaction #include <signal.h> -#include <bits/kernel_sigaction.h> + +int __syscall_rt_sigaction (int __signum, const struct sigaction *__act, + struct sigaction *__oldact, size_t __size); #define __NR___syscall_rt_sigaction __NR_rt_sigaction _syscall4(int, __syscall_rt_sigaction, int, signum, diff --git a/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/libc/sysdeps/linux/common/bits/kernel_sigaction.h index f74e0a28a..0a35ac8cb 100644 --- a/libc/sysdeps/linux/common/bits/kernel_sigaction.h +++ b/libc/sysdeps/linux/common/bits/kernel_sigaction.h @@ -25,12 +25,12 @@ struct old_kernel_sigaction { */ extern int __syscall_sigaction(int, const struct old_kernel_sigaction *, - struct old_kernel_sigaction *) attribute_hidden; + struct old_kernel_sigaction *); #endif extern int __syscall_rt_sigaction(int, const struct sigaction *, - struct sigaction *, size_t) attribute_hidden; + struct sigaction *, size_t); #endif /* _BITS_SIGACTION_STRUCT_H */ diff --git a/libc/sysdeps/linux/common/bits/sigaction.h b/libc/sysdeps/linux/common/bits/sigaction.h index 48cc5312f..7489aa878 100644 --- a/libc/sysdeps/linux/common/bits/sigaction.h +++ b/libc/sysdeps/linux/common/bits/sigaction.h @@ -21,34 +21,26 @@ # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." #endif -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ +/* Structure describing the action to be taken when a signal arrives. + * In uclibc, it is identical to "new" struct kernel_sigaction + * (one from the Linux 2.1.68 kernel). + * This minimizes amount of translation in sigaction(). + */ +struct sigaction { #ifdef __USE_POSIX199309 - union - { - /* Used if SA_SIGINFO is not set. */ - __sighandler_t sa_handler; - /* Used if SA_SIGINFO is set. */ - void (*sa_sigaction) (int, siginfo_t *, void *); - } - __sigaction_handler; -# define sa_handler __sigaction_handler.sa_handler -# define sa_sigaction __sigaction_handler.sa_sigaction + union { + __sighandler_t sa_handler; + void (*sa_sigaction)(int, siginfo_t *, void *); + } __sigaction_handler; +# define sa_handler __sigaction_handler.sa_handler +# define sa_sigaction __sigaction_handler.sa_sigaction #else - __sighandler_t sa_handler; + __sighandler_t sa_handler; #endif - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - - /* Restore handler. */ - void (*sa_restorer) (void); - }; + unsigned long sa_flags; + void (*sa_restorer)(void); + sigset_t sa_mask; +}; /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ diff --git a/libc/sysdeps/linux/common/bits/sigset.h b/libc/sysdeps/linux/common/bits/sigset.h index 75fa32604..2f67a4ebf 100644 --- a/libc/sysdeps/linux/common/bits/sigset.h +++ b/libc/sysdeps/linux/common/bits/sigset.h @@ -22,13 +22,24 @@ typedef int __sig_atomic_t; -/* A `sigset_t' has a bit for each signal. */ - -# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; +/* A 'sigset_t' has a bit for each signal. + * glibc has space for 1024 signals (!), but most arches supported + * by Linux have 64 signals, and only MIPS has 128. + * There seems to be some historical baggage in sparc[64] + * where they might have (or had in the past) 32 signals only, + * I hope it's irrelevant now. + * Signal 0 does not exist, so we have signals 1..64, not 0..63. + * In uclibc, kernel and userspace sigset_t is always the same. + * BTW, struct sigaction is also the same on kernel and userspace side. + */ +#if defined(__mips__) +# define _SIGSET_NWORDS (128 / (8 * sizeof (unsigned long))) +#else +# define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long))) +#endif +typedef struct { + unsigned long __val[_SIGSET_NWORDS]; +} __sigset_t; #endif |