#include #include #include #include #include #include "dietfeatures.h" #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif int mkstemp(char* template) { char *tmp=template+strlen(template)-6; int randfd; int i,res; unsigned int random; if (tmp>(i*5))&0x1f; tmp[i]=hexdigit>9?hexdigit+'a'-10:hexdigit+'0'; } res=open(template,O_CREAT|O_RDWR|O_EXCL|O_NOFOLLOW,0600); if (res>=0 || errno!=EEXIST) break; } //close(randfd); return res; }