11 char *__mktemp(char *);
13 char *mkdtemp(char *template)
16 if (!__mktemp(template)) return 0;
17 if (!mkdir(template, 0700)) return template;
18 if (errno != EEXIST) return 0;
19 /* this is safe because mktemp verified
20 * that we have a valid template string */
21 strcpy(template+strlen(template)-6, "XXXXXX");