Can anybody point me to the code that implements mkstemp() (C/C++) on Win32, or very close analog?
Must be race-free.
It’s supposed to look like
#include <windows.h>
#include <io.h>
// port of mkstemp() to win32. race-free.
// behaviour as described in http://linux.die.net/man/3/mkstemp
//
int mkstemp(char *template) {
...
}
You can use the following function which is extracted from
wcecompatlibrary (from filesrc/stdlib_extras.cpp)It defines
O_EXCLas;You can rip out mkstemp support out of it easily.