lkml.org 
[lkml]   [2009]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc: fix reported unit for RLIMIT_CPU
On Tue, Jul 07, 2009 at 09:23:32PM -0700, Kees Cook wrote:
> /proc/$pid/limits should show RLIMIT_CPU as seconds, which is the unit
> used in kernel/posix-cpu-timers.c:
>
> unsigned long psecs = cputime_to_secs(ptime);
> ...
> if (psecs >= sig->rlim[RLIMIT_CPU].rlim_max) {
> ...
> __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
>
> Signed-off-by: Kees Cook <kees.cook@canonical.com>
> ---
> fs/proc/base.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 3ce5ae9..5891360 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -461,7 +461,7 @@ struct limit_names {
> };
>
> static const struct limit_names lnames[RLIM_NLIMITS] = {
> - [RLIMIT_CPU] = {"Max cpu time", "ms"},
> + [RLIMIT_CPU] = {"Max cpu time", "seconds"},
> [RLIMIT_FSIZE] = {"Max file size", "bytes"},
> [RLIMIT_DATA] = {"Max data size", "bytes"},
> [RLIMIT_STACK] = {"Max stack size", "bytes"},

Yup, thanks!
Acked-by: Neil Horman <nhorman@tuxdriver.com>


\
 
 \ /
  Last update: 2009-07-08 12:21    [W:0.046 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site