[lkml]   [2012]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/1] procfs: expose umask in stat and status
On Sat, May 5, 2012 at 5:15 AM, Cong Wang <> 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.



 \ /
  Last update: 2012-05-05 07:01    [W:0.152 / U:0.084 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site