15 static char s2[L_tmpnam];
22 if (__syscall(SYS_access, P_tmpdir, R_OK|W_OK|X_OK) != 0)
26 __syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts, 0);
27 n = ts.tv_nsec ^ (uintptr_t)&s ^ (uintptr_t)s;
28 snprintf(s, L_tmpnam, "/tmp/t%x-%x", a_fetch_add(&index, 1), n);
29 } while (!__syscall(SYS_access, s, F_OK) && try++<MAXTRIES);
30 return try>=MAXTRIES ? 0 : s;