]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Consolidate fxstat{64}
authorAndreas Schwab <schwab@suse.de>
Sun, 21 Feb 2021 20:56:59 +0000 (21:56 +0100)
committerAndreas Schwab <schwab@suse.de>
Sun, 7 Mar 2021 14:42:45 +0000 (15:42 +0100)
sysdeps/unix/sysv/linux/fxstat64.c
sysdeps/unix/sysv/linux/fxstatat64.c

index be1279827307a3311a969d3304a6e0cecf989866..056126e13dff3b011fca6e5cf862f1d10e7e3b3b 100644 (file)
@@ -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.  */
index f442bff6241d43a386fb31b0042c032fc2df406c..a9441e000115cc0a00f2bc58a80c8fb8c544a69b 100644 (file)
@@ -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)