11 char *__randname(char *);
13 char *tempnam(const char *dir, const char *pfx)
20 if (!dir) dir = P_tmpdir;
21 if (!pfx) pfx = "temp";
25 l = dl + 1 + pl + 1 + 6;
34 memcpy(s+dl+1, pfx, pl);
37 for (try=0; try<MAXTRIES; try++) {
39 r = __syscall(SYS_lstat, s, &(struct stat){0});
40 if (r == -ENOENT) return strdup(s);