]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
open.2: Say a bit more about what happens when 'mode' is wrongly omitted
authorMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 24 Jul 2020 11:26:38 +0000 (13:26 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 24 Jul 2020 11:26:38 +0000 (13:26 +0200)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/open.2

index f83326cbc3742a321cdffc913397b0bcd042f2ae..aedbe0460df12f47185cfad2880003f740c6675f 100644 (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
-or
+nor
 .B O_TMPFILE
 is specified in
-.IR flags ;
-if neither
+.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
-nor
+or
 .B O_TMPFILE
-is specified, then
-.I mode
-is ignored.
+is specified in
+.IR flags ;
+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