summaryrefslogtreecommitdiff
path: root/libc/manual/stdio.texi
diff options
context:
space:
mode:
Diffstat (limited to 'libc/manual/stdio.texi')
-rw-r--r--libc/manual/stdio.texi35
1 files changed, 27 insertions, 8 deletions
diff --git a/libc/manual/stdio.texi b/libc/manual/stdio.texi
index 0d23daae2..c58ca22b2 100644
--- a/libc/manual/stdio.texi
+++ b/libc/manual/stdio.texi
@@ -196,13 +196,31 @@ Additional characters may appear after these to specify flags for the
call. Always put the mode (@samp{r}, @samp{w+}, etc.) first; that is
the only part you are guaranteed will be understood by all systems.
-@Theglibc{} defines one additional character for use in
-@var{opentype}: the character @samp{x} insists on creating a new
-file---if a file @var{filename} already exists, @code{fopen} fails
-rather than opening it. If you use @samp{x} you are guaranteed that
-you will not clobber an existing file. This is equivalent to the
-@code{O_EXCL} option to the @code{open} function (@pxref{Opening and
-Closing Files}).
+@Theglibc{} defines additional characters for use in @var{opentype}:
+
+@table @samp
+@item c
+The file is opened with cancellation in the I/O functions disabled.
+
+@item e
+The underlying file descriptor will be closed if you use any of the
+@code{exec@dots{}} functions (@pxref{Executing a File}). (This is
+equivalent to having set @code{FD_CLOEXEC} on that descriptor.
+@xref{Descriptor Flags}.)
+
+@item m
+The file is opened and accessed using @code{mmap}. This is only
+supported with files opened for reading.
+
+@item x
+Insist on creating a new file---if a file @var{filename} already
+exists, @code{fopen} fails rather than opening it. If you use
+@samp{x} you are guaranteed that you will not clobber an existing
+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}.
+@end table
The character @samp{b} in @var{opentype} has a standard meaning; it
requests a binary stream rather than a text stream. But this makes no
@@ -5003,7 +5021,8 @@ ssize_t @var{writer} (void *@var{cookie}, const char *@var{buffer}, size_t @var{
This is very similar to the @code{write} function; see @ref{I/O
Primitives}. Your function should transfer up to @var{size} bytes from
the buffer, and return the number of bytes written. You can return a
-value of @code{-1} to indicate an error.
+value of @code{0} to indicate an error. You must not return any
+negative value.
You should define the function to perform seek operations on the cookie
as: