diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c index ae704958ba..7b45ab0583 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c @@ -32,13 +32,25 @@ #include <sysdep.h> #include <sys/syscall.h> +#include <statx_cp.h> + /* Get information about the file NAME in BUF. */ int __xstat64 (int vers, const char *name, struct stat64 *buf) { if (vers == _STAT_VER_KERNEL) - return INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); - + { +#ifdef __NR_fstatat64 + return INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0); +#else + struct statx tmp; + int rc = INLINE_SYSCALL (statx, 5, AT_FDCWD, name, AT_NO_AUTOMOUNT, + STATX_BASIC_STATS, &tmp); + if (rc == 0) + __cp_stat64_statx (buf, &tmp); + return rc; +#endif + } errno = EINVAL; return -1; } |