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