mirror of https://github.com/mkerrisk/man-pages
umask.2: Provide a rationale for the existence of /proc/PID/status 'Umask' field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
ac6c297c7b
commit
8a2de39c05
12
man2/umask.2
12
man2/umask.2
|
@ -117,10 +117,22 @@ inherits its parent's umask.
|
|||
The umask is left unchanged by
|
||||
.BR execve (2).
|
||||
|
||||
It is impossible to user
|
||||
.BR umask ()
|
||||
to fetch a process's umask without at the same time changing it.
|
||||
A second call to
|
||||
.BR umask ()
|
||||
would then be needed to restore the umask.
|
||||
The nonatomicity of these two steps provides the potential
|
||||
for races in multithreaded programs.
|
||||
|
||||
Since Linux 4.7, the umask of any process can be viewed via the
|
||||
.I Umask
|
||||
field of
|
||||
.IR /proc/[pid]/status .
|
||||
Inspecting this field in
|
||||
.IR /proc/self/status
|
||||
allows a process to retrieve its umask without at the same time changing it.
|
||||
|
||||
The umask setting also affects the permissions assigned to POSIX IPC objects
|
||||
.RB ( mq_open (3),
|
||||
|
|
Loading…
Reference in New Issue