From 4751bbe2ad4d1bfa05774e29376d553ecfe563b0 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 14 Jun 2016 17:56:33 -0300 Subject: Fix p{readv,writev}{64} consolidation implementation This patch fixes the p{readv,writev}{64} consolidation implementation from commits 4e77815 and af5fdf5. Different from pread/pwrite implementation, preadv/pwritev implementation does not require __ALIGNMENT_ARG because kernel syscall prototypes define the high and low part of the off_t, if it is the case, directly (different from pread/pwrite where the architecture ABI for passing 64-bit values must be in consideration for passsing the arguments). It also adds some basic tests for preadv/pwritev. Tested on x86_64, i686, and armhf. * misc/Makefile (tests): Add tst-preadvwritev and tst-preadvwritev64. * misc/tst-preadvwritev.c: New file. * misc/tst-preadvwritev64.c: Likewise. * sysdeps/unix/sysv/linux/preadv.c (preadv): Remove SYSCALL_LL{64} usage. * sysdeps/unix/sysv/linux/preadv64.c (preadv64): Likewise. * sysdeps/unix/sysv/linux/pwritev.c (pwritev): Likewise. * sysdeps/unix/sysv/linux/pwritev64.c (pwritev64): Likewise. * sysdeps/unix/sysv/linux/sysdep.h (LO_HI_LONG): New macro. --- sysdeps/unix/sysv/linux/preadv64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/sysv/linux/preadv64.c') diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c index 18f55508ad..64164bbe6b 100644 --- a/sysdeps/unix/sysv/linux/preadv64.c +++ b/sysdeps/unix/sysv/linux/preadv64.c @@ -27,8 +27,7 @@ ssize_t preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) { - return SYSCALL_CANCEL (preadv64, fd, vector, count, - __ALIGNMENT_ARG SYSCALL_LL64 (offset)); + return SYSCALL_CANCEL (preadv64, fd, vector, count, LO_HI_LONG (offset)); } #else static ssize_t __atomic_preadv64_replacement (int, const struct iovec *, @@ -38,7 +37,7 @@ preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) { #ifdef __NR_preadv64 ssize_t result = SYSCALL_CANCEL (preadv64, fd, vector, count, - __ALIGNMENT_ARG SYSCALL_LL64 (offset)); + LO_HI_LONG (offset)); if (result >= 0 || errno != ENOSYS) return result; #endif -- cgit 1.4.1