diff options
author | Chris Dearman <chris.dearman@imgtec.com> | 2013-12-09 19:58:42 -0800 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2014-01-08 17:48:48 +0000 |
commit | 2b4bb1c445ee16339efd76ec04834606bcb9bc46 (patch) | |
tree | 426faeb60e813c48f4ad169e59320f0ef79e7cc9 | |
parent | ac655a878e15007a5517e449920707598d7c5024 (diff) | |
download | strace-2b4bb1c445ee16339efd76ec04834606bcb9bc46.tar.gz strace-2b4bb1c445ee16339efd76ec04834606bcb9bc46.tar.bz2 strace-2b4bb1c445ee16339efd76ec04834606bcb9bc46.tar.xz |
mips: fix sigaction reporting
MIPS userland uses the same sigaction structure with a full signal
mask for old_sigaction and new_sigaction and does does not have
an sa_restorer field.
These changes have been tested on MIPS O32 big/little endian, MIPS N64
big endian and x86-64.
* signal.c (old_sigaction) [MIPS]: Add definition for MIPS.
(decode_old_sigaction) [MIPS]: Print sa_mask according to its definition.
(new_sigaction) [MIPS]: Add definition for MIPS.
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
-rw-r--r-- | signal.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -669,10 +669,17 @@ sys_sigsetmask(struct tcb *tcp) struct old_sigaction { /* sa_handler may be a libc #define, need to use other name: */ +#ifdef MIPS + unsigned int sa_flags; + void (*__sa_handler)(int); + /* Kernel treats sa_mask as an array of longs. */ + unsigned long sa_mask[NSIG / sizeof(long) ? NSIG / sizeof(long) : 1]; +#else void (*__sa_handler)(int); unsigned long sa_mask; unsigned long sa_flags; void (*sa_restorer)(void); +#endif /* !MIPS */ }; static void @@ -709,7 +716,11 @@ decode_old_sigaction(struct tcb *tcp, long addr) tprints("{SIG_IGN, "); else tprintf("{%#lx, ", (long) sa.__sa_handler); +#ifdef MIPS + tprints(sprintsigmask("", (sigset_t *)sa.sa_mask)); +#else tprints(sprintsigmask_long("", sa.sa_mask)); +#endif tprints(", "); printflags(sigact_flags, sa.sa_flags, "SA_???"); #ifdef SA_RESTORER @@ -1210,9 +1221,14 @@ sys_rt_sigprocmask(struct tcb *tcp) struct new_sigaction { /* sa_handler may be a libc #define, need to use other name: */ +#ifdef MIPS + unsigned int sa_flags; + void (*__sa_handler)(int); +#else void (*__sa_handler)(int); unsigned long sa_flags; void (*sa_restorer)(void); +#endif /* !MIPS */ /* Kernel treats sa_mask as an array of longs. */ unsigned long sa_mask[NSIG / sizeof(long) ? NSIG / sizeof(long) : 1]; }; |