[PATCH] RLIMIT_CPU: document wrong return value
authorAndrew Morton <akpm@osdl.org>
Fri, 24 Mar 2006 11:18:36 +0000 (03:18 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 24 Mar 2006 15:33:30 +0000 (07:33 -0800)
Document the fact that setrlimit(RLIMIT_CPU) doesn't return error codes when
it should.  I don't think we can fix this without a 2.7.x..

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/sys.c

index 9e157e0240d449de46eff7ad3735c131f24ad3ec..19d058be49d496252534b95bd241512d24aed271 100644 (file)
@@ -1656,6 +1656,13 @@ asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
 
        if (resource != RLIMIT_CPU)
                goto out;
+
+       /*
+        * RLIMIT_CPU handling.   Note that the kernel fails to return an error
+        * code if it rejected the user's attempt to set RLIMIT_CPU.  This is a
+        * very long-standing error, and fixing it now risks breakage of
+        * applications, so we live with it
+        */
        if (new_rlim.rlim_cur == RLIM_INFINITY)
                goto out;