aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/signal.h
diff options
context:
space:
mode:
authorGeorge Anzinger <george@mvista.com>2006-01-08 01:02:48 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 20:13:53 -0800
commit71fabd5e4835309b4feca6209122ce56c595c461 (patch)
tree7d9467a4f9678d2271f82d48ec075a316cb1523f /include/linux/signal.h
parent[PATCH] keys: Permit running process to instantiate keys (diff)
downloadlinux-dev-71fabd5e4835309b4feca6209122ce56c595c461.tar.xz
linux-dev-71fabd5e4835309b4feca6209122ce56c595c461.zip
[PATCH] sigaction should clear all signals on SIG_IGN, not just < 32
While rooting aroung in the signal code trying to understand how to fix the SIG_IGN ploy (set sig handler to SIG_IGN and flood system with high speed repeating timers) I came across what, I think, is a problem in sigaction() in that when processing a SIG_IGN request it flushes signals from 1 to SIGRTMIN and leaves the rest. Attempt to fix this. Signed-off-by: George Anzinger <george@mvista.com> Cc: Roland McGrath <roland@redhat.com> Cc: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/signal.h')
-rw-r--r--include/linux/signal.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ea9eff16c4b7..b7d093520bb6 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -94,6 +94,23 @@ static inline int sigfindinword(unsigned long word)
#endif /* __HAVE_ARCH_SIG_BITOPS */
+static inline int sigisemptyset(sigset_t *set)
+{
+ extern void _NSIG_WORDS_is_unsupported_size(void);
+ switch (_NSIG_WORDS) {
+ case 4:
+ return (set->sig[3] | set->sig[2] |
+ set->sig[1] | set->sig[0]) == 0;
+ case 2:
+ return (set->sig[1] | set->sig[0]) == 0;
+ case 1:
+ return set->sig[0] == 0;
+ default:
+ _NSIG_WORDS_is_unsupported_size();
+ return 0;
+ }
+}
+
#define sigmask(sig) (1UL << ((sig) - 1))
#ifndef __HAVE_ARCH_SIG_SETOPS