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