summaryrefslogtreecommitdiff
path: root/linux-Only-build-fstatat-fallback-if-required.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-Only-build-fstatat-fallback-if-required.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'linux-Only-build-fstatat-fallback-if-required.patch')
-rw-r--r--linux-Only-build-fstatat-fallback-if-required.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/linux-Only-build-fstatat-fallback-if-required.patch b/linux-Only-build-fstatat-fallback-if-required.patch
new file mode 100644
index 0000000..093d5b6
--- /dev/null
+++ b/linux-Only-build-fstatat-fallback-if-required.patch
@@ -0,0 +1,52 @@
+From c3b023a7822185c9176cfb96eeca4ada3d662c4b Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 24 Nov 2021 12:57:57 -0300
+Subject: [PATCH] linux: Only build fstatat fallback if required
+
+For 32-bit architecture with __ASSUME_STATX there is no need to
+build fstatat64_time64_stat.
+
+Checked on i686-linux-gnu.
+---
+ sysdeps/unix/sysv/linux/fstatat64.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
+index f968e4ef05..50ae5ad748 100644
+--- a/sysdeps/unix/sysv/linux/fstatat64.c
++++ b/sysdeps/unix/sysv/linux/fstatat64.c
+@@ -74,6 +74,17 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf,
+ return r;
+ }
+
++#if (__WORDSIZE == 32 \
++ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
++ || defined STAT_HAS_TIME32
++# define FSTATAT_USE_STATX 1
++#else
++# define FSTATAT_USE_STATX 0
++#endif
++
++/* Only statx supports 64-bit timestamps for 32-bit architectures with
++ __ASSUME_STATX, so there is no point in building the fallback. */
++#if !FSTATAT_USE_STATX || (FSTATAT_USE_STATX && !defined __ASSUME_STATX)
+ static inline int
+ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
+ int flag)
+@@ -134,13 +145,6 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
+
+ return r;
+ }
+-
+-#if (__WORDSIZE == 32 \
+- && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
+- || defined STAT_HAS_TIME32
+-# define FSTATAT_USE_STATX 1
+-#else
+-# define FSTATAT_USE_STATX 0
+ #endif
+
+ int
+--
+2.33.0
+