Re: [PATCH] Add rlimits to /proc/<PID>/status

From: Peter Zijlstra
Date: Fri May 30 2008 - 17:47:47 EST


On Fri, 2008-05-30 at 22:11 +0200, Clifford Wolf wrote:
> Signed-off-by: Clifford Wolf <clifford@xxxxxxxxxxx>
> ---
> fs/proc/array.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 57 insertions(+), 0 deletions(-)
>
> diff --git a/fs/proc/array.c b/fs/proc/array.c
> index 9e3b8c3..3cb2ad3 100644
> --- a/fs/proc/array.c
> +++ b/fs/proc/array.c
> @@ -242,6 +242,62 @@ static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign,
> }
> }
>
> +static const char *rlim_names[RLIM_NLIMITS] = {
> + [RLIMIT_CPU] = "CPU",
> + [RLIMIT_FSIZE] = "FSize",
> + [RLIMIT_DATA] = "Data",
> + [RLIMIT_STACK] = "Stack",
> + [RLIMIT_CORE] = "Core",
> + [RLIMIT_RSS] = "RSS",
> + [RLIMIT_NPROC] = "NProc",
> + [RLIMIT_NOFILE] = "NoFile",
> + [RLIMIT_MEMLOCK] = "MemLock",
> + [RLIMIT_AS] = "AddrSpace",
> + [RLIMIT_LOCKS] = "Locks",
> + [RLIMIT_SIGPENDING] = "SigPending",
> + [RLIMIT_MSGQUEUE] = "MsgQueue",
> + [RLIMIT_NICE] = "Nice",
> + [RLIMIT_RTPRIO] = "RTPrio",
> + [RLIMIT_RTTIME] = "RTTime"
> +};

fs/proc/base.c already has an array with strings in it

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/