]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[PATCH] RLIMIT_CPU: fix handling of a zero limit
authorAndrew Morton <akpm@osdl.org>
Fri, 24 Mar 2006 11:18:35 +0000 (03:18 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 17 Apr 2006 20:16:06 +0000 (13:16 -0700)
commit284a7c99c01846ee44040268529c99fc92dcc531
tree73722b8f455d37ce6160cebc90f6d2734ce7aee4
parentbc5bd8ac3c6956c7ce2c838e8e2f01435b8e4e0b
[PATCH] RLIMIT_CPU: fix handling of a zero limit

At present the kernel doesn't honour an attempt to set RLIMIT_CPU to zero
seconds.  But the spec says it should, and that's what 2.4.x does.

Fixing this for real would involve some complexity (such as adding a new
it-has-been-set flag to the task_struct, and testing that everwhere, instead
of overloading the value of it_prof_expires).

Given that a 2.4 kernel won't actually send the signal until one second has
expired anyway, let's just handle this case by treating the caller's
zero-seconds as one second.

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