1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
29 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2001-11-17, aeb
31 .TH TMPFILE 3 2021-03-22 "" "Linux Programmer's Manual"
33 tmpfile \- create a temporary file
38 .B FILE *tmpfile(void);
43 function opens a unique temporary file
44 in binary read/write (w+b) mode.
45 The file will be automatically deleted when it is closed or the
50 function returns a stream descriptor, or NULL if
51 a unique filename cannot be generated or the unique file cannot be
55 is set to indicate the error.
59 Search permission denied for directory in file's path prefix.
62 Unable to generate a unique filename.
65 The call was interrupted by a signal; see
69 The per-process limit on the number of open file descriptors has been reached.
72 The system-wide limit on the total number of open files has been reached.
75 There was no room in the directory to add the new filename.
80 For an explanation of the terms used in this section, see
88 Interface Attribute Value
91 T} Thread safety MT-Safe
97 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD, SUSv2.
99 POSIX.1-2001 specifies:
100 an error message may be written to
105 The standard does not specify the directory that
108 Glibc will try the path prefix
113 and if that fails, then the directory