11 char *tmpnam(char *buf)
13 static char internal[L_tmpnam];
14 char s[] = "/tmp/tmpnam_XXXXXX";
17 for (try=0; try<MAXTRIES; try++) {
20 r = __syscall(SYS_lstat, s, &(struct stat){0});
22 r = __syscall(SYS_fstatat, AT_FDCWD, s,
23 &(struct stat){0}, AT_SYMLINK_NOFOLLOW);
25 if (r == -ENOENT) return strcpy(buf ? buf : internal, s);