[PATCH] manual: fopen with the x flag does not follow ISO C11
Florian Weimer
fweimer@redhat.com
Mon Dec 9 19:16:00 GMT 2019
ISO C11 requires that the new file is created locked, something
that our implementation does not do. Changing that would impact
backwards compatibility, particularly if the C11 requirement of
“exclusive (also known as non-shared) access to the extent that
the underlying system supports exclusive access” is read to imply
mandatory locking.
-----
manual/stdio.texi | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/manual/stdio.texi b/manual/stdio.texi
index bbd3061bab..33a0250a9a 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -216,7 +216,11 @@ exists, @code{fopen} fails rather than opening it. If you use
file. This is equivalent to the @code{O_EXCL} option to the
@code{open} function (@pxref{Opening and Closing Files}).
-The @samp{x} modifier is part of @w{ISO C11}.
+@strong{Portability Note:} Some standards describe the @samp{x}
+specifier with different semantics, requiring that exclusive,
+mandatory file locking is enabled for the new file. The
+implementation in @theglibc{} follows existing practice and only
+passes the @code{O_EXCL} flag to the kernel.
@end table
The character @samp{b} in @var{opentype} has a standard meaning; it
More information about the Libc-alpha
mailing list