safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_lib.h"
Functions | |
EXPORT errno_t | tmpnam_s (char *filename_s, rsize_t maxsize) |
Creates a unique valid file name (no longer than L_tmpnam in length) and stores it in character string pointed to by filename. More... | |
EXPORT errno_t tmpnam_s | ( | char * | filename_s, |
rsize_t | maxsize | ||
) |
Creates a unique valid file name (no longer than L_tmpnam in length) and stores it in character string pointed to by filename.
The function is capable of generating up to TMP_MAX_S of unique filenames, but some or all of them may be in use in the filesystem and thus not suitable return values.
[out] | filename_s | pointer to the character array capable of holding at least L_tmpnam_s bytes, to be used as a result buffer. |
[in] | maxsize | maximum number of characters the function is allowed to write (typically the size of the filename_s array). |
EOK | on success |
ESNULLP | when filename_s is a NULL pointer |
ESZEROL | when maxsize = 0 |
ESLEMAX | when maxsize > RSIZE_MAX_STR or more than TMP_MAX_S files were opened. |
errno() | when tmpnam() failed, typically -ENOENT |
POSIX systems additionally define the similarly named function tempnam(), which offers the choice of a directory (which defaults to the optionally defined macro P_tmpdir).