The tmpfile() function generates a unique temporary filename. 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 normally.
An error message may be written to stdout if the stream cannot be opened.
The standard does not specify the directory that tmpfile() will use.
Glibc will try the path prefix P_tmpdir defined in
<stdio.h>, and if that fails the directory /tmp.