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