TMPFILE(3S) SysV TMPFILE(3S)
NAME
tmpfile - create a temporary file
SYNOPSIS
#include <stdio.h>
FILE *tmpfile ( void );
DESCRIPTION
tmpfile creates a temporary file using a name generated by tmpnam(3S),
and returns a corresponding FILE pointer. If the file cannot be opened,
an error message is printed using perror(3C), and a NULL pointer is
returned. The file will automatically be deleted when the process using
it terminates. The file is opened for update ("w+").
RETURN VALUES
Upon successful completion, the tmpfile function returns a pointer to the
stream of the file that is created. Otherwise, it returns a null pointer
and sets errno to indicate the error.
ERRORS
If the tmpfile function fails, errno is set to one of the following
values:
[EMFILE] OPEN_MAX file descriptors are currently open in the
calling process.
[ENFILE] Too many files are currently open in the system.
[ENOSPC] The directory or file system that would contain the new
file cannot be expanded.
SEE ALSO
creat(2), unlink(2), fopen(3S), mktemp(3C), perror(3C), stdio(3S),
tmpnam(3S).