[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 5 May 2012 06:19:46 +0200
From: Pierre Carrier <pierre@...tify.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Rob Landley <rob@...dley.net>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] procfs: expose umask in stat and status
On Sat, May 5, 2012 at 5:15 AM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> How is it useful to display numeric -ENOENT in a /proc file?
The fields in stat are looked up by index, so they should all always appear.
Sticking to a numerical value makes both this code and parsing
reasonably straightforward.
Given expected values are masks, a negative value makes a good marker.
Overall I don't see a compelling reason to avoid an errno.
They seem common in kernel outputs and benefit from some tooling
(self-promotion: [1]).
Would you have a better idea in mind?
> So sometimes "Umask:" is displayed, sometimes not...
Well, it is displayed whenever available (which sounds better to my ear).
This seemed consistent with the current practices: status already has
guards for FDSize, Groups, VmPeak, VmSize, VmLck, VmPin, VmHWM, VmRSS,
VmData, VmStk, VmExe, VmLib, VmPTE, VmSwap.
In all honesty I can't think of a realistic situation where one would
look for a umask in a task that doesn't have one.
--
Pierre
[1] https://github.com/pcarrier/stuff/blob/master/sys/errnos.c
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists