Products
and Services Support
and Docs Training Partner Programs About Red
Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation: man pages: man3: Linux Programmer's Manual (3)

Manpage of TMPFILE

TMPFILE

Section: Linux Programmer's Manual (3)
Updated: April 3, 2025
Index  

NAME

tmpfile - create a temporary file  

SYNOPSIS

#include <stdio.h>
FILE *tmpfile (void);
 

DESCRIPTION

The tmpfile() function generates a unique temporary filename using the path prefix P_tmpdir defined in <stdio.h>. The temporary file is then opened in binary read/write (w+b) mode. The file will be automatically deleted when it is closed or the program terminates.  

RETURN VALUE

The tmpfile() function returns a stream descriptor, or NULL if a unique filename cannot be generated or the unique file cannot be opened.  

ERRORS

EACCES
Search permission denied for directory in file's path prefix.
EEXIST
Unable to generate a unique filename.
EMFILE
Too many file descriptors in use by process.
ENFILE
Too many files open in system.
EROFS
Read-only filesystem.
 

CONFORMING TO

SVID 3, POSIX, BSD 4.3, ISO 9899  

SEE ALSO


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
CONFORMING TO
SEE ALSO

This document was created by using the manual pages.
Time: 11:58:07 GMT, March 24, 2025

 

 


 
© 2001 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat