Fix p{readv,writev}{64} consolidation implementation

System Internals / glibc - Adhemerval Zanella [linaro.org] - 21 June 2016 09:29 UTC

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.

4751bbe Fix p{readv,writev}{64} consolidation implementation
ChangeLog | 12 ++++
misc/Makefile | 3 +-
misc/tst-preadvwritev.c | 114 +++++++++++++++++++++++++++++++++++
misc/tst-preadvwritev64.c | 22 +++++++
sysdeps/unix/sysv/linux/preadv.c | 5 +-
sysdeps/unix/sysv/linux/preadv64.c | 5 +-
sysdeps/unix/sysv/linux/pwritev.c | 5 +-
sysdeps/unix/sysv/linux/pwritev64.c | 7 +--
sysdeps/unix/sysv/linux/sysdep.h | 9 +++
9 files changed, 168 insertions(+), 14 deletions(-)

Upstream: sourceware.org


  • Share