]> granicus.if.org Git - strace/commitdiff
ARM: remove wrong NSIG = 32 define
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 18 Jul 2013 07:41:20 +0000 (09:41 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Thu, 18 Jul 2013 07:41:20 +0000 (09:41 +0200)
ARM in fact has 64 signals (1..64), and NSIG should be 65
(as usual, rememebr that NSIG_libc == NSIG_kernel+1).

I carefully reviewed all usages of NSIG. In syscall.c,
the only usage is:
        for (i = 0; i <= NSIG; i++)
                if (strcasecmp(s, signame(i) + 3) == 0)...
which is safe even if NSIG is way too big - signame(i)
returns a well-formed string for any i.

In signal.c, memcpy(&sigset, &sc.sc_mask, NSIG / 8) is used by
IA64 and TILE code, so ARM change can't affect it. And final
usage is:
 struct new_sigaction::unsigned long sa_mask[NSIG / sizeof(long)];
It will grow on ARM (and become correct in the process).
Its only use is
 memcpy(&sigset, &sa.sa_mask, NSIG / 8);
 printsigmask(&sigset, 1);
which used to copy garbage in high bits, now it will copy actual data.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
signal.c
syscall.c

index 4e35274cc925f94e513e618ebd7368a908f7a048..7f8ed52d5487bc7e067e19a0ce911889b9333cbc 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -89,11 +89,6 @@ struct sigcontext {
 # warning: NSIG is not defined, using 32
 # define NSIG 32
 #endif
-#ifdef ARM
-/* Ugh. Is this really correct? ARM has no RT signals?! */
-# undef NSIG
-# define NSIG 32
-#endif
 
 #ifdef HAVE_SIGACTION
 
index a27fee9b32e0726bf69ee1225db5a24a82a56df9..02c0867985a341fbaab65b51d30ee238e9653084 100644 (file)
--- a/syscall.c
+++ b/syscall.c
 # warning: NSIG is not defined, using 32
 # define NSIG 32
 #endif
-#ifdef ARM
-/* Ugh. Is this really correct? ARM has no RT signals?! */
-# undef NSIG
-# define NSIG 32
-#endif
 
 #include "syscall.h"