This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] manual: Document the O_TMPFILE flag
- From: fweimer at redhat dot com (Florian Weimer)
- To: libc-alpha at sourceware dot org
- Date: Fri, 03 Nov 2017 22:37:14 +0100
- Subject: [PATCH] manual: Document the O_TMPFILE flag
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61173C058EC2
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