Commit 58e1dd1e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Incorrect value for SIGRTMAX

From: Corey Minyard <minyard@acm.org>

I was having a problem with signals with POSIX timers, and it turns out 
that the value of SIGRTMAX is incorrect.  Remember that there is no
signal 0, so the signals should go from 1-_NSIG.  However, SIGRTMAX is
defined as (_NSIG-1) in all architectures.  The following patch fixes this.

This define is only used in drivers/usb/core/devio.c and 
kernel/posix-timers.c, and both are incorrect without this fix.  There's
also no check for zero in posix-timers.c, that fix is part of the diff.

Also, shouldn't do_sigaction() use this value instead of _NSIG?  It's
not a big deal, but some architectures have different values for _NSIG
and SIGRTMAX.
parent 32ca1b05
......@@ -71,7 +71,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
#define SIGSWI 32
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
#define SIGSWI 32
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -70,7 +70,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -50,7 +50,7 @@
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -59,7 +59,7 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -42,7 +42,7 @@
/* These should not be considered constants from userland. */
#define SIGRTMIN 37
#define SIGRTMAX (_NSIG-1) /* it's 44 under HP/UX */
#define SIGRTMAX _NSIG /* it's 44 under HP/UX */
/*
* SA_FLAGS values:
......
......@@ -61,7 +61,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -57,7 +57,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -78,7 +78,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -57,7 +57,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -89,7 +89,7 @@
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
#define SIGRTMAX (__NEW_NSIG - 1)
#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
......
......@@ -89,7 +89,7 @@
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
#define SIGRTMAX (__NEW_NSIG - 1)
#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
......
......@@ -71,7 +71,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -77,7 +77,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
#define SIGRTMAX (_NSIG-1)
#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
......
......@@ -344,6 +344,7 @@ static inline struct task_struct * good_sigevent(sigevent_t * event)
return NULL;
if ((event->sigev_notify & ~SIGEV_NONE & MIPS_SIGEV) &&
event->sigev_signo &&
((unsigned) (event->sigev_signo > SIGRTMAX)))
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment