tmpfile(3S) tmpfile(3S)
NAME
tmpfile, tmpfile64 - create a temporary file
SYNOPSIS
#include <stdio.h>
FILE *tmpfile(void);
FILE *tmpfile64(void);
DESCRIPTION
tmpfile() creates a temporary file using a name generated by the
tmpnam(3S) routine and returns a corresponding FILE pointer. If the
file cannot be opened, errno is used to issue an error message, and a
null pointer is returned. The file is automatically deleted when the
process using it terminates or when the file is closed. The file is
opened for update ("w+").
The largest value that can be represented correctly in an object of
type offt will be established as the offset maximum in the open file
description.
There is no functional difference between tmpfile() and tmpfile64(),
except for the interpretation of off64t [see lfs(5)].
ERRORS
The following error code descriptions are function-specific. You will
find a general description in introprm2(2) or in errno(5).
The tmpfile() function will fail if:
EINTR A signal was caught during the tmpfile() function.
EMFILE The number of open files exceeds OPENMAX.
ENFILE The system file table is full.
ENOSPC No new file can be opened in the directory or file system.
RETURN VALUE
Upon successful completion, tmpfile() 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.
SEE ALSO
creat(2), open(2), unlink(2), mktemp(3C), perror(3C), fopen(3S),
stdio(3S), tmpnam(3S), lfs(5), stdio(5).
Page 1 Reliant UNIX 5.44 Printed 11/98