All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] procfs: expose umask in /proc/<PID>/status (formerly umask2, formerly getumask)
@ 2016-04-14  9:34 Richard W.M. Jones
  2016-04-14  9:34 ` [PATCH] procfs: expose umask in /proc/<PID>/status Richard W.M. Jones
  2016-04-14  9:36 ` [PATCH] procfs: expose umask in /proc/<PID>/status (formerly umask2, formerly getumask) Richard W.M. Jones
  0 siblings, 2 replies; 4+ messages in thread
From: Richard W.M. Jones @ 2016-04-14  9:34 UTC (permalink / raw)
  To: corbet
  Cc: akpm, vbabka, mhocko, hughd, koct9i, chenhanxiao, n-horiguchi,
	ross.zwisler, john.stultz, minchan, jmarchan, hannes, nathans,
	andriy.shevchenko, keescook, gorcunov, joe, linux, mingo,
	cmetcalf, iago, luto, linux-doc, linux-kernel, gorcunov, fw,
	walters

It's not possible to read the process umask without also modifying it,
which is what umask(2) does.  A library cannot read umask safely,
especially if the main program might be multithreaded.

Add a new status line ("Umask") in /proc/<PID>/status.  It contains
the file mode creation mask (umask) in octal.  It is only shown for
tasks which have task->fs.

For the library this allows me to read the umask from
/proc/self/status.

This patch is adapted from one originally written by Pierre Carrier:
https://lkml.org/lkml/2012/5/4/451

Rich.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-14 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14  9:34 [PATCH] procfs: expose umask in /proc/<PID>/status (formerly umask2, formerly getumask) Richard W.M. Jones
2016-04-14  9:34 ` [PATCH] procfs: expose umask in /proc/<PID>/status Richard W.M. Jones
2016-04-14 10:21   ` Jerome Marchand
2016-04-14  9:36 ` [PATCH] procfs: expose umask in /proc/<PID>/status (formerly umask2, formerly getumask) Richard W.M. Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.