|
@@ -5,7 +5,6 @@
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
#include "syscall.h"
|
|
#include "syscall.h"
|
|
-#include "kstat.h"
|
|
|
|
|
|
|
|
#define MAXTRIES 100
|
|
#define MAXTRIES 100
|
|
|
|
|
|
@@ -17,11 +16,10 @@ char *tmpnam(char *buf)
|
|
int r;
|
|
int r;
|
|
for (try=0; try<MAXTRIES; try++) {
|
|
for (try=0; try<MAXTRIES; try++) {
|
|
__randname(s+12);
|
|
__randname(s+12);
|
|
-#ifdef SYS_lstat
|
|
|
|
- r = __syscall(SYS_lstat, s, &(struct kstat){0});
|
|
|
|
|
|
+#ifdef SYS_readlink
|
|
|
|
+ r = __syscall(SYS_readlink, s, (char[1]){0}, 1);
|
|
#else
|
|
#else
|
|
- r = __syscall(SYS_fstatat, AT_FDCWD, s,
|
|
|
|
- &(struct kstat){0}, AT_SYMLINK_NOFOLLOW);
|
|
|
|
|
|
+ r = __syscall(SYS_readlinkat, AT_FDCWD, s, (char[1]){0}, 1);
|
|
#endif
|
|
#endif
|
|
if (r == -ENOENT) return strcpy(buf ? buf : internal, s);
|
|
if (r == -ENOENT) return strcpy(buf ? buf : internal, s);
|
|
}
|
|
}
|