7.19.4.4 The tmpnam function
Synopsis
#include <stdio.h>
char *tmpnam(char *s);
Description
The tmpnam function generates a string that is a valid file name and that is not the same as the name of an existing file.[1] The function is potentially capable of generating TMP_MAX different strings, but any or all of them may already be in use by existing files and thus not be suitable return values.
The tmpnam function generates a different string each time it is called.
The implementation shall behave as if no library function calls the tmpnam function.
Returns
If no suitable string can be generated, the tmpnam function returns a null pointer. Otherwise, if the argument is a null pointer, the tmpnam function leaves its result in an internal static object and returns a pointer to that object (subsequent calls to the tmpnam function may modify the same object). If the argument is not a null pointer, it is assumed to point to an array of at least L_tmpnam chars; the tmpnam function writes its result in that array and returns the argument as its value.
Environmental limits
The value of the macro TMP_MAX shall be at least 25.
Footnotes