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: Document the O_TMPFILE flag


2017-11-03  Florian Weimer  <fweimer@redhat.com>

	* manual/llio.texi (Open-time Flags): Document O_TMPFILE.

diff --git a/manual/llio.texi b/manual/llio.texi
index e72c53c785..b2123beefe 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -3478,6 +3478,25 @@ If set, the file will be created if it doesn't already exist.
 If both @code{O_CREAT} and @code{O_EXCL} are set, then @code{open} fails
 if the specified file already exists.  This is guaranteed to never
 clobber an existing file.
+
+The @code{O_EXCL} flag has a special meaning in combination with
+@code{O_TMPFILE}; see below.
+@end deftypevr
+
+@deftypevr Macro int O_TMPFILE
+@standards{GNU, fcntl.h} If this flag is specified, functions in the
+@code{open} family create an unnamed temporary file in the directory
+@var{filename}.  The @code{O_TMPFILE} flag must be combined with
+@code{O_WRONLY} or @code{O_RDWR}, and the @var{mode} argument is
+required.  The file can later be given a name using @code{linkat}.  To
+prevent that, specify the @code{O_EXCL} flag at open time.
+
+Not all kernels support this open flag.  If this flag is unsupported,
+the function call fails with an error of @code{EINVAL}.  If the
+underlying file system does not support the @code{O_TMPFILE} flag, an
+@code{EOPNOTSUPP} error is the result.
+
+The @code{O_TMPFILE} flag is a GNU extension.
 @end deftypevr
 
 @deftypevr Macro int O_NONBLOCK


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