summaryrefslogtreecommitdiff
path: root/linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch')
-rw-r--r--linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch b/linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch
new file mode 100644
index 0000000..7d23c67
--- /dev/null
+++ b/linux-use-statx-for-fstat-if-neither-newfstatat-nor-.patch
@@ -0,0 +1,36 @@
+From e6547d635b991651600fab31f788ed5facd77610 Mon Sep 17 00:00:00 2001
+From: WANG Xuerui <git@xen0n.name>
+Date: Wed, 1 Jun 2022 10:12:28 +0800
+Subject: [PATCH] linux: use statx for fstat if neither newfstatat nor
+ fstatat64 is present
+
+LoongArch is going to be the first architecture supported by Linux that
+has neither fstat* nor newfstatat [1], instead exclusively relying on
+statx. So in fstatat64's implementation, we need to also enable statx
+usage if neither fstatat64 nor newfstatat is present, to prepare for
+this new case of kernel ABI.
+
+[1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/
+
+Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+---
+ sysdeps/unix/sysv/linux/fstatat64.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index 2ab914380d..8b1a1a290d 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -42,7 +42,8 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+
+ #if (__WORDSIZE == 32 \
+ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+- || defined STAT_HAS_TIME32
++ || defined STAT_HAS_TIME32 \
++ || (!defined __NR_newfstatat && !defined __NR_fstatat64)
+ # define FSTATAT_USE_STATX 1
+
+ static inline int
+--
+2.33.0
+