11 char *__mktemp(char *template)
14 size_t l = strlen(template);
18 if (l < 6 || strcmp(template+l-6, "XXXXXX")) {
23 clock_gettime(CLOCK_REALTIME, &ts);
24 r = ts.tv_nsec + (uintptr_t)&ts / 16 + (uintptr_t)template;
26 snprintf(template+l-6, 7, "%06lX", r & 0xffffff);
27 if (access(template, F_OK) < 0) return template;
28 r = r * 1103515245 + 12345;
35 weak_alias(__mktemp, mktemp);