safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_lib.h"
Functions | |
EXPORT errno_t | tmpfile_s (FILE *restrict *restrict streamptr) |
The tmpfile_s function creates a temporary binary file that is different from any other existing file and that will automatically be removed when it is closed or at program termination. More... | |
EXPORT errno_t tmpfile_s | ( | FILE *restrict *restrict | streamptr | ) |
The tmpfile_s
function creates a temporary binary file that is different from any other existing file and that will automatically be removed when it is closed or at program termination.
If the program terminates abnormally, whether an open temporary file is removed is implementation-defined. The file is opened for update with "wb+" mode with the meaning that mode has in the fopen_s
function (including the mode’s effect on exclusive access and file permissions).
streamptr | pointer to a pointer that will be updated by this function call |
If the file was created successfully, then the pointer to FILE pointed to by streamptr will be set to the pointer to the object controlling the opened file. Otherwise, the pointer to FILE pointed to by streamptr will be set to a null pointer.
EOK | on success |
ESNULLP | when streamptr is a NULL pointer |
ESLEMAX | when more than TMP_MAX_S files were opened. |
errno() | when tmpfile() failed, typically ENOENT |