This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] manual: fopen with the x flag does not follow ISO C11


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]