From: Denys Vlasenko Date: Thu, 18 Jul 2013 07:41:20 +0000 (+0200) Subject: ARM: remove wrong NSIG = 32 define X-Git-Tag: v4.9~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94e10354d888d1f09bc803616869802a13a576bf;p=strace ARM: remove wrong NSIG = 32 define 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 --- diff --git a/signal.c b/signal.c index 4e35274c..7f8ed52d 100644 --- 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 diff --git a/syscall.c b/syscall.c index a27fee9b..02c08679 100644 --- a/syscall.c +++ b/syscall.c @@ -84,11 +84,6 @@ # 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"