diff options
author | Andreas Schwab <schwab@suse.de> | 2021-02-21 21:56:59 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2021-03-07 15:42:45 +0100 |
commit | d6d180e896624efa778e3c39b9db6b0576346921 (patch) | |
tree | 4419e8d7a7118c799e69d230b73ab18c5d87bc73 /sysdeps | |
parent | 66ea7d034284cf0f0a705a51517a9d05e67765cc (diff) | |
download | glibc-d6d180e896624efa778e3c39b9db6b0576346921.tar.gz |
linux: Consolidate fxstat{64}
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/fxstat64.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/fxstatat64.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c index be12798273..056126e13d 100644 --- a/sysdeps/unix/sysv/linux/fxstat64.c +++ b/sysdeps/unix/sysv/linux/fxstat64.c @@ -35,6 +35,7 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf) { #if XSTAT_IS_XSTAT64 # ifdef __NR_fstat64 +# ifdef __NR_fstat /* 64-bit kABI outlier, e.g. sparc64. */ if (vers == _STAT_VER_KERNEL) return INLINE_SYSCALL_CALL (fstat, fd, buf); @@ -44,6 +45,9 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf) int r = INLINE_SYSCALL_CALL (fstat64, fd, &st64); return r ?: __xstat32_conv (vers, &st64, (struct stat *) buf); } +# else + return INLINE_SYSCALL_CALL (fstat64, fd, buf); +# endif # elif defined __NR_fstat /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and x86_64. */ diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c index f442bff624..a9441e0001 100644 --- a/sysdeps/unix/sysv/linux/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/fxstatat64.c @@ -40,10 +40,15 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX) return INLINE_SYSCALL_CALL (newfstatat, fd, file, st, flag); # elif defined __NR_fstatat64 +# ifdef __NR_fstat /* 64-bit kABI outlier, e.g. sparc64. */ struct stat64 st64; int r = INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); return r ?: __xstat32_conv (vers, &st64, (struct stat *) st); +# else + if (vers == _STAT_VER_LINUX) + return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag); +# endif # else /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ if (vers == _STAT_VER_KERNEL) |