open.2: Say a bit more about what happens when 'mode' is wrongly omitted

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-07-24 13:26:38 +02:00
parent 88f463a9be
commit 901c8ecf7c
1 changed files with 17 additions and 9 deletions

View File

@ -289,20 +289,28 @@ mount options described in
.IP
The
.I mode
argument specifies the file mode bits be applied when a new file is created.
This argument must be supplied when
argument specifies the file mode bits to be applied when a new file is created.
If neither
.B O_CREAT
nor
.B O_TMPFILE
is specified in
.IR flags ,
then
.I mode
is ignored (and can thus be specified as 0, or simply omitted).
The
.I mode
argument
.B must
be supplied if
.B O_CREAT
or
.B O_TMPFILE
is specified in
.IR flags ;
if neither
.B O_CREAT
nor
.B O_TMPFILE
is specified, then
.I mode
is ignored.
if it is not supplied,
some arbitrary bytes from the stack will be applied as the file mode.
.IP
The effective mode is modified by the process's
.I umask