aboutsummaryrefslogtreecommitdiffstats
path: root/man/man3/tmpfile.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-04-26 15:06:49 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-02 01:24:19 +0200
commitdcde2f70372b49ec43efc5db864c9ff585d0a2dd (patch)
tree78b9b7425130e4a5858e4c01a524d802423879ed /man/man3/tmpfile.3
parent12aca537ce78a41bbcdaf485209691e10f8002d7 (diff)
downloadman-pages-dcde2f70372b49ec43efc5db864c9ff585d0a2dd.tar.gz
man/, share/mk/: Move man*/ to man/
This is a scripted change: $ mkdir man/; $ mv man* man/; $ ln -st . man/man*; $ find share/mk/ -type f \ | xargs grep -l '^MANDIR *:=' \ | xargs sed -i '/^MANDIR *:=/s,$,/man,'; $ find share/mk/dist/ -type f \ | xargs grep -l man \ | xargs sed -i 's,man%,man/%,g'; Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/> Cc: Petr Vorel <pvorel@suse.cz> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3/tmpfile.3')
-rw-r--r--man/man3/tmpfile.3103
1 files changed, 103 insertions, 0 deletions
diff --git a/man/man3/tmpfile.3 b/man/man3/tmpfile.3
new file mode 100644
index 0000000000..1bfcdabf3f
--- /dev/null
+++ b/man/man3/tmpfile.3
@@ -0,0 +1,103 @@
+'\" t
+.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\" References consulted:
+.\" Linux libc source code
+.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
+.\" 386BSD man pages
+.\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
+.\" Modified 2001-11-17, aeb
+.TH tmpfile 3 (date) "Linux man-pages (unreleased)"
+.SH NAME
+tmpfile \- create a temporary file
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " \-lc )
+.SH SYNOPSIS
+.nf
+.B #include <stdio.h>
+.P
+.B FILE *tmpfile(void);
+.fi
+.SH DESCRIPTION
+The
+.BR tmpfile ()
+function opens a unique temporary file
+in binary read/write (w+b) mode.
+The file will be automatically deleted when it is closed or the
+program terminates.
+.SH RETURN VALUE
+The
+.BR tmpfile ()
+function returns a stream descriptor, or NULL if
+a unique filename cannot be generated or the unique file cannot be
+opened.
+In the latter case,
+.I errno
+is set to indicate the error.
+.SH ERRORS
+.TP
+.B EACCES
+Search permission denied for directory in file's path prefix.
+.TP
+.B EEXIST
+Unable to generate a unique filename.
+.TP
+.B EINTR
+The call was interrupted by a signal; see
+.BR signal (7).
+.TP
+.B EMFILE
+The per-process limit on the number of open file descriptors has been reached.
+.TP
+.B ENFILE
+The system-wide limit on the total number of open files has been reached.
+.TP
+.B ENOSPC
+There was no room in the directory to add the new filename.
+.TP
+.B EROFS
+Read-only filesystem.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR tmpfile ()
+T} Thread safety MT-Safe
+.TE
+.SH VERSIONS
+The standard does not specify the directory that
+.BR tmpfile ()
+will use.
+glibc will try the path prefix
+.I P_tmpdir
+defined
+in
+.IR <stdio.h> ,
+and if that fails, then the directory
+.IR /tmp .
+.SH STANDARDS
+C11, POSIX.1-2008.
+.SH HISTORY
+POSIX.1-2001, C89, SVr4, 4.3BSD, SUSv2.
+.SH NOTES
+POSIX.1-2001 specifies:
+an error message may be written to
+.I stdout
+if the stream
+cannot be opened.
+.SH SEE ALSO
+.BR exit (3),
+.BR mkstemp (3),
+.BR mktemp (3),
+.BR tempnam (3),
+.BR tmpnam (3)