char *tmpnam(char *str);

Generates and returns a valid temporary filename which does not exist. Up to TMP_MAX different filenames can be generated.

If the argument str is a null pointer, then the function returns a pointer to a valid filename. If the argument str is a valid pointer to an array, then the filename is written to the array and a pointer to the same array is returned. The filename may be up to L_tmpnam characters long.