]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86-64: Update LO_HI_LONG for p{readv,writev}{64}v2
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 5 Jun 2017 14:21:44 +0000 (07:21 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 5 Jun 2017 14:21:57 +0000 (07:21 -0700)
The kernel interface for p{readv,writev}{64}v is

(unsigned long fd, {const }struct iovec *iov, unsigned long vlen,
 unsigned long pos_l, unsigned long pos_h)

Except for targets which define __ARCH_WANT_COMPAT_SYS_PREADV64 and
__ARCH_WANT_COMPAT_SYS_PWRITEV64,

(unsigned long fd, {const }struct iovec *iov, unsigned long vlen,
 off64_t pos)

is used for p{readv,writev}{64}v.  X32 is the only such target.  The
LO_HI_LONG macro is used to pass offset to the pos_l and pos_h pair.
Since pos_h is ignored when size of offset == sizeof of pos_l, x86-64
has

 #define LO_HI_LONG(val) (val)

But the kernel interface for p{readv,writev}{64}v2 is

(unsigned long fd, {const }struct iovec *iov, unsigned long vlen,
 unsigned long pos_l, unsigned long pos_h, int flags)

Except for targets which define __ARCH_WANT_COMPAT_SYS_PREADV64V2 and
__ARCH_WANT_COMPAT_SYS_PWRITEV64V2,

(unsigned long fd, {const }struct iovec *iov, unsigned long vlen,
 off64_t pos, int flags)

is used for p{readv,writev}{64}v2.  X32 is the only such target.  Update
x86-64 LO_HI_LONG to pass 0 as the high part of the offset argument for
p{readv,writev}{64}v2 and define a different LO_HI_LONG for x32 to only
pass one argument for offset.

Tested on x32 and x86-64.

* sysdeps/unix/sysv/linux/x86_64/sysdep.h (LO_HI_LONG): Pass
0 as the high part of offset.
* sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (LO_HI_LONG): New.

ChangeLog
sysdeps/unix/sysv/linux/x86_64/sysdep.h
sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h

index ff791f711c97b7df5a76ad1237b16fee10fb36e7..1cbcf564e0bea7efcc9af08fa15c157a98852cf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/unix/sysv/linux/x86_64/sysdep.h (LO_HI_LONG): Pass
+       0 as the high part of offset.
+       * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (LO_HI_LONG): New.
+
 2017-06-05  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #21538]
index 7b8bd795b7cf0e964ae44284123d9852f198354a..880e496880ad856dc50fd094e6c65efc48267d68 100644 (file)
 
 /* How to pass the off{64}_t argument on p{readv,writev}{64}.  */
 #undef LO_HI_LONG
-#define LO_HI_LONG(val) (val)
+#define LO_HI_LONG(val) (val), 0
 
 #endif /* linux/x86_64/sysdep.h */
index f90fcfaeef552f43ca2748bc4c070c2ece24cb09..04c73a2bc13628e37c0cdcbab6307d62e4c59959 100644 (file)
@@ -22,4 +22,8 @@
 #include <sysdeps/unix/sysv/linux/x86_64/sysdep.h>
 #include <sysdeps/x86_64/x32/sysdep.h>
 
+/* How to pass the off{64}_t argument on p{readv,writev}{64}.  */
+#undef LO_HI_LONG
+#define LO_HI_LONG(val) (val)
+
 #endif /* linux/x86_64/x32/sysdep.h */