10 char *__randname(char *);
12 char *tmpnam(char *buf)
14 static char internal[L_tmpnam];
15 char s[] = "/tmp/tmpnam_XXXXXX";
18 for (try=0; try<MAXTRIES; try++) {
21 r = __syscall(SYS_lstat, s, &(struct stat){0});
23 r = __syscall(SYS_fstatat, AT_FDCWD, s,
24 &(struct stat){0}, AT_SYMLINK_NOFOLLOW);
26 if (r == -ENOENT) return strcpy(buf ? buf : internal, s);