2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
11 .\" Modified 2001-11-17, aeb
12 .TH tmpfile 3 (date) "Linux man-pages (unreleased)"
14 tmpfile \- create a temporary file
17 .RI ( libc ", " \-lc )
22 .B FILE *tmpfile(void);
27 function opens a unique temporary file
28 in binary read/write (w+b) mode.
29 The file will be automatically deleted when it is closed or the
34 function returns a stream descriptor, or NULL if
35 a unique filename cannot be generated or the unique file cannot be
39 is set to indicate the error.
43 Search permission denied for directory in file's path prefix.
46 Unable to generate a unique filename.
49 The call was interrupted by a signal; see
53 The per-process limit on the number of open file descriptors has been reached.
56 The system-wide limit on the total number of open files has been reached.
59 There was no room in the directory to add the new filename.
64 For an explanation of the terms used in this section, see
70 Interface Attribute Value
75 T} Thread safety MT-Safe
78 The standard does not specify the directory that
81 glibc will try the path prefix
86 and if that fails, then the directory
91 POSIX.1-2001, C89, SVr4, 4.3BSD, SUSv2.
93 POSIX.1-2001 specifies:
94 an error message may be written to