
From: Chris Wright <chrisw@osdl.org>

The following patches introduce per user rlimits for both queued signals and
POSIX message queues.  The changes touch all the arches resource.h files as
well as init_task.c to get the rlimit defaults setup.

Both require caching the user_struct to avoid problems with setuid().

The signal changes makes some small changes to send_signal() to pass along the
task being signalled to get proper accounting for signals initiated in
interrupt.  Thanks to Marcelo for getting this one going.


This patch:

Add an rlimit entry to control the maximum number of pending signals a user
may have.  This is essentially just the resource.h changes.


---

 25-akpm/include/asm-alpha/resource.h   |    8 +++++---
 25-akpm/include/asm-arm/resource.h     |    4 +++-
 25-akpm/include/asm-arm26/resource.h   |    4 +++-
 25-akpm/include/asm-cris/resource.h    |    8 +++++---
 25-akpm/include/asm-h8300/resource.h   |    6 ++++--
 25-akpm/include/asm-i386/resource.h    |    7 +++++--
 25-akpm/include/asm-ia64/resource.h    |    4 +++-
 25-akpm/include/asm-m68k/resource.h    |    6 ++++--
 25-akpm/include/asm-mips/resource.h    |    4 +++-
 25-akpm/include/asm-parisc/resource.h  |    4 +++-
 25-akpm/include/asm-ppc/resource.h     |    4 +++-
 25-akpm/include/asm-ppc64/resource.h   |    4 +++-
 25-akpm/include/asm-s390/resource.h    |    6 ++++--
 25-akpm/include/asm-sh/resource.h      |    4 +++-
 25-akpm/include/asm-sparc/resource.h   |   10 ++++++----
 25-akpm/include/asm-sparc64/resource.h |   10 ++++++----
 25-akpm/include/asm-v850/resource.h    |    6 ++++--
 25-akpm/include/asm-x86_64/resource.h  |    6 ++++--
 25-akpm/include/linux/signal.h         |    3 +++
 19 files changed, 74 insertions(+), 34 deletions(-)

diff -puN include/asm-alpha/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-alpha/resource.h
--- 25/include/asm-alpha/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-alpha/resource.h	Tue May 11 15:21:13 2004
@@ -15,9 +15,10 @@
 #define RLIMIT_AS	7		/* address space limit(?) */
 #define RLIMIT_NPROC	8		/* max number of processes */
 #define RLIMIT_MEMLOCK	9		/* max locked-in-memory address space */
-#define RLIMIT_LOCKS   10              /* maximum file locks held */
+#define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.  Fine, it's unsigned, but
@@ -40,7 +41,8 @@
     {LONG_MAX, LONG_MAX},			/* RLIMIT_AS */		\
     {LONG_MAX, LONG_MAX},			/* RLIMIT_NPROC */	\
     {LONG_MAX, LONG_MAX},			/* RLIMIT_MEMLOCK */	\
-    {LONG_MAX, LONG_MAX},                       /* RLIMIT_LOCKS */      \
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_LOCKS */	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},		/* RLIMIT_SIGPENDING */ \
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-arm26/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-arm26/resource.h
--- 25/include/asm-arm26/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-arm26/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 #ifdef __KERNEL__
 
@@ -40,6 +41,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
+	{ MAX_SIGPENDING, MAX_SIGPENDING},	\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-arm/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-arm/resource.h
--- 25/include/asm-arm/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-arm/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 #ifdef __KERNEL__
 
@@ -40,6 +41,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
+	{ MAX_SIGPENDING, MAX_SIGPENDING},	\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-cris/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-cris/resource.h
--- 25/include/asm-cris/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-cris/resource.h	Tue May 11 15:21:13 2004
@@ -15,9 +15,10 @@
 #define RLIMIT_NOFILE	7		/* max number of open files */
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
-#define RLIMIT_LOCKS   10              /* maximum file locks held */
+#define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -38,8 +39,9 @@
 	{             0,             0 },		\
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },               \
-        { RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-h8300/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-h8300/resource.h
--- 25/include/asm-h8300/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-h8300/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +40,8 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-i386/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-i386/resource.h
--- 25/include/asm-i386/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-i386/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+
+#define RLIM_NLIMITS	12
 
-#define RLIM_NLIMITS	11
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +41,8 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-ia64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-ia64/resource.h
--- 25/include/asm-ia64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-ia64/resource.h	Tue May 11 15:21:13 2004
@@ -23,8 +23,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -47,6 +48,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 # endif /* __KERNEL__ */
diff -puN include/asm-m68k/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-m68k/resource.h
--- 25/include/asm-m68k/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-m68k/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +40,8 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-mips/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-mips/resource.h
--- 25/include/asm-mips/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-mips/resource.h	Tue May 11 15:21:13 2004
@@ -23,8 +23,9 @@
 #define RLIMIT_NPROC 8			/* max number of processes */
 #define RLIMIT_MEMLOCK 9		/* max locked-in-memory address space */
 #define RLIMIT_LOCKS 10			/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS 11			/* Number of limit flavors.  */
+#define RLIM_NLIMITS 12			/* Number of limit flavors.  */
 
 #ifdef __KERNEL__
 
@@ -54,6 +55,7 @@
 	{ 0,             0             },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-parisc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-parisc/resource.h
--- 25/include/asm-parisc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-parisc/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -40,6 +41,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-ppc64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-ppc64/resource.h
--- 25/include/asm-ppc64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-ppc64/resource.h	Tue May 11 15:21:13 2004
@@ -21,8 +21,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit(?) */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 #ifdef __KERNEL__
 
@@ -46,6 +47,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-ppc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-ppc/resource.h
--- 25/include/asm-ppc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-ppc/resource.h	Tue May 11 15:21:13 2004
@@ -12,8 +12,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit(?) */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 #ifdef __KERNEL__
 
@@ -37,6 +38,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-s390/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-s390/resource.h
--- 25/include/asm-s390/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-s390/resource.h	Tue May 11 15:21:13 2004
@@ -24,8 +24,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
-  
-#define RLIM_NLIMITS	11
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -48,6 +49,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-sh/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-sh/resource.h
--- 25/include/asm-sh/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-sh/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 #ifdef __KERNEL__
 
@@ -40,6 +41,7 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-sparc64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-sparc64/resource.h
--- 25/include/asm-sparc64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-sparc64/resource.h	Tue May 11 15:21:13 2004
@@ -19,11 +19,12 @@
 #define RLIMIT_RSS	5		/* max resident set size */
 #define RLIMIT_NOFILE	6		/* max number of open files */
 #define RLIMIT_NPROC	7		/* max number of processes */
-#define RLIMIT_MEMLOCK  8               /* max locked-in-memory address space */
-#define RLIMIT_AS       9               /* address space limit */
+#define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
+#define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -43,7 +44,8 @@
     {INR_OPEN, INR_OPEN}, {0, 0},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
-    {RLIM_INFINITY, RLIM_INFINITY}	\
+    {RLIM_INFINITY, RLIM_INFINITY},	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},	\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-sparc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-sparc/resource.h
--- 25/include/asm-sparc/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-sparc/resource.h	Tue May 11 15:21:13 2004
@@ -19,11 +19,12 @@
 #define RLIMIT_RSS	5		/* max resident set size */
 #define RLIMIT_NOFILE	6		/* max number of open files */
 #define RLIMIT_NPROC	7		/* max number of processes */
-#define RLIMIT_MEMLOCK  8               /* max locked-in-memory address space */
-#define RLIMIT_AS       9               /* address space limit */
+#define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
+#define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -44,7 +45,8 @@
     {INR_OPEN, INR_OPEN}, {0, 0},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
-    {RLIM_INFINITY, RLIM_INFINITY}	\
+    {RLIM_INFINITY, RLIM_INFINITY},	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},	\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-v850/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-v850/resource.h
--- 25/include/asm-v850/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-v850/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +40,8 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/asm-x86_64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/asm-x86_64/resource.h
--- 25/include/asm-x86_64/resource.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/asm-x86_64/resource.h	Tue May 11 15:21:13 2004
@@ -16,8 +16,9 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	12
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +40,8 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
 }
 
 #endif /* __KERNEL__ */
diff -puN include/linux/signal.h~rlim-add-rlimit-entry-for-controlling-queued-signals include/linux/signal.h
--- 25/include/linux/signal.h~rlim-add-rlimit-entry-for-controlling-queued-signals	Tue May 11 15:21:13 2004
+++ 25-akpm/include/linux/signal.h	Tue May 11 15:21:13 2004
@@ -7,6 +7,9 @@
 #include <asm/siginfo.h>
 
 #ifdef __KERNEL__
+
+#define MAX_SIGPENDING	1024
+
 /*
  * Real Time signals may be queued.
  */

_
