1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
10 .\" Modified 2001-11-17, aeb
11 .TH tmpfile 3 (date) "Linux man-pages (unreleased)"
13 tmpfile \- create a temporary file
16 .RI ( libc ", " \-lc )
21 .B FILE *tmpfile(void);
26 function opens a unique temporary file
27 in binary read/write (w+b) mode.
28 The file will be automatically deleted when it is closed or the
33 function returns a stream descriptor, or NULL if
34 a unique filename cannot be generated or the unique file cannot be
38 is set to indicate the error.
42 Search permission denied for directory in file's path prefix.
45 Unable to generate a unique filename.
48 The call was interrupted by a signal; see
52 The per-process limit on the number of open file descriptors has been reached.
55 The system-wide limit on the total number of open files has been reached.
58 There was no room in the directory to add the new filename.
63 For an explanation of the terms used in this section, see
71 Interface Attribute Value
74 T} Thread safety MT-Safe
80 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD, SUSv2.
82 POSIX.1-2001 specifies:
83 an error message may be written to
88 The standard does not specify the directory that
91 Glibc will try the path prefix
96 and if that fails, then the directory