libetpan - fdik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

21 lines
383 B

#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
int mkstemp (char *tmp_template) {
int fd;
char * res;
#ifdef _DEBUG
printf("mkstemp:%s\n", tmp_template);
#endif
fd = -1;
res = mktemp( tmp_template);
if (res && *res) {
fd = open( res, _O_BINARY | _O_CREAT | _O_TEMPORARY | _O_EXCL, _S_IREAD | _S_IWRITE);
}
return fd;
}