|
@@ -6,7 +6,6 @@
|
|
#include <stdint.h>
|
|
#include <stdint.h>
|
|
#include <sys/sysmacros.h>
|
|
#include <sys/sysmacros.h>
|
|
#include "syscall.h"
|
|
#include "syscall.h"
|
|
-#include "kstat.h"
|
|
|
|
|
|
|
|
struct statx {
|
|
struct statx {
|
|
uint32_t stx_mask;
|
|
uint32_t stx_mask;
|
|
@@ -69,6 +68,10 @@ static int fstatat_statx(int fd, const char *restrict path, struct stat *restric
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef SYS_fstatat
|
|
|
|
+
|
|
|
|
+#include "kstat.h"
|
|
|
|
+
|
|
static int fstatat_kstat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
|
static int fstatat_kstat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
@@ -130,15 +133,20 @@ static int fstatat_kstat(int fd, const char *restrict path, struct stat *restric
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
int __fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
|
int __fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
+#ifdef SYS_fstatat
|
|
if (sizeof((struct kstat){0}.st_atime_sec) < sizeof(time_t)) {
|
|
if (sizeof((struct kstat){0}.st_atime_sec) < sizeof(time_t)) {
|
|
ret = fstatat_statx(fd, path, st, flag);
|
|
ret = fstatat_statx(fd, path, st, flag);
|
|
if (ret!=-ENOSYS) return __syscall_ret(ret);
|
|
if (ret!=-ENOSYS) return __syscall_ret(ret);
|
|
}
|
|
}
|
|
ret = fstatat_kstat(fd, path, st, flag);
|
|
ret = fstatat_kstat(fd, path, st, flag);
|
|
|
|
+#else
|
|
|
|
+ ret = fstatat_statx(fd, path, st, flag);
|
|
|
|
+#endif
|
|
return __syscall_ret(ret);
|
|
return __syscall_ret(ret);
|
|
}
|
|
}
|
|
|
|
|