This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix LO_HI_LONG definition
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 4 Jul 2016 14:08:00 -0300
- Subject: [PATCH] Fix LO_HI_LONG definition
- Authentication-results: sourceware.org; auth=none
The p{read,write}v{64} consolidation patch [1] added a wrong guard
for LO_HI_LONG definition. It currently uses both
'__WORDSIZE == 64' and 'defined __ASSUME_WORDSIZE64_ILP32' to set
the value to be passed in one argument, otherwise it will be split
in two.
However it fails on MIPS64n32 where syscalls n32 uses the compat
implementation in the kernel meaning the off_t arguments are passed
in two separate registers.
GLIBC already defines a macro for such cases (__OFF_T_MATCHES_OFF64_T),
so this patch uses it instead.
Checked on x86_64, i686, x32, aarch64, armhf, and s390x.
[1] 4751bbe2ad4d1bfa05774e29376d553ecfe563b0
---
ChangeLog | 4 ++++
sysdeps/unix/sysv/linux/sysdep.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 7213a8d..9983d6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2016-07-04 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * sysdeps/unix/sysv/linux/sysdep.h
+ [__WORDSIZE == 64 || __ASSUME_WORDSIZE64_ILP32] (LO_HI_LONG): Use
+ __OFF_T_MATCHES_OFF64_T to define macro.
+
* sysdeps/unix/sysv/linux/mips/kernel-features.h
(__ASSUME_OFF_DIFF_OFF64): Remove define.
* sysdeps/unix/sysv/linux/pread.c
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index 8c9e62e..5c31249 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -49,7 +49,7 @@
#endif
/* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}. */
-#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32
+#ifdef __OFF_T_MATCHES_OFF64_T
# define LO_HI_LONG(val) (val)
#else
# define LO_HI_LONG(val) \
--
2.7.4