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