summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/pwritev64.c
Commit message (Collapse)AuthorAgeFilesLines
* posix: Fix and simplify default p{read,write}v implementationAdhemerval Zanella2017-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all architectures but microblaze use wire-up syscall for p{readv,write}v. Microblaze still uses the syscall emulation using sysdep/posix/p{readv,writev}.c and it was reported in some ocasions [1] [2] that it might have some issues with some linux specific usage (mainly with O_DIRECT and the alignment requirement). Although it is not an issue for virtually all the system, this patch refactors the sysdeps/posix p{read,write}v syscall to avoid such issue (by using posix_memalign on the buffer used on p{read,write} call) and by refactoring it common files to avoid the need check on defines to correct set the alias and internal symbols. Checked on microblaze-linux-gnu check with run-built-tests=no and by using the sysdeps/posix implementation on x86_64-linux-gnu (just for sanity test where it shown no regression). * sysdeps/posix/preadv.c: Use sysdeps/posix/preadv_common.c. * sysdeps/posix/preadv64.c: Likewise. * sysdeps/unix/sysv/linux/preadv.c: Likewise. * sysdeps/unix/sysv/linux/preadv64.c: Likewise. * sysdeps/posix/pwritev.c: Use sysdeps/posix/pwritev_common.c. * sysdeps/posix/pwritev64.c: Likewise. * sysdeps/unix/sysv/linux/pwritev.c: Likewise. * sysdeps/unix/sysv/linux/pwritev64.c: Likewise. * sysdeps/posix/preadv_common.c: New file. * sysdeps/posix/pwritev_common.c: Likewise. [1] http://www.mail-archive.com/qemu-devel@nongnu.org/msg25282.html [2] https://bugzilla.redhat.com/show_bug.cgi?id=563103#c8
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Remove __ASSUME_OFF_DIFF_OFF64 definitionAdhemerval Zanella2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the __ASSUME_OFF_DIFF_OFF64 define introduced in p{read,write} consolidation patch. This define was added based on the idea 32 bits ports would continue to follow previous off{64}_t definition where off_t size differs from off64_t one. However, with recent AArch64/ILP32 patch submission and also with discussion for RISCV kernel interface, 32 bits ports now may aim to use off_t and off64_t with the same size as 64 bits. So current assumption for both p{read,write} and p{read,write}v are not compatible with new type definition. This patch now makes the syscall wrappers to only depend on __OFF_T_MATCHES_OFF64_T to define the default and 64-suffix variant, as follow: <function>.c #ifndef __OFF_T_MATCHES_OFF64_T /* build <function> */ #endif and <function>64.c /* build <function>64 */ #ifdef __OFF_T_MATCHES_OFF64_T weak_alias (fallocate64, fallocate) #endif Tested on x86_64, i686, x32, and armhf. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_OFF_DIFF_OFF64): Remove define. * sysdeps/unix/sysv/linux/pread.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread): Replace by __OFF_T_MATCHES_OFF64_T. * sysdeps/unix/sysv/linux/pread64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread64): Likewise. * sysdeps/unix/sysv/linux/preadv.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv): Likewise. * sysdeps/unix/sysv/linux/preadv64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv64): Likewise. * sysdeps/unix/sysv/linux/pwrite.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite): Likewise. * sysdeps/unix/sysv/linux/pwrite64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite64): Likewise. * sysdeps/unix/sysv/linux/pwritev.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev): Likewise. * sysdeps/unix/sysv/linux/pwritev64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev64): Likewise.
* Fix p{readv,writev}{64} consolidation implementationAdhemerval Zanella2016-06-211-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Consolidate pwritev/pwritev64 implementationsAdhemerval Zanella2016-06-061-5/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the pwritev{64} implementation for Linux in only one (sysdeps/unix/sysv/linux/pwritev{64}.c). It also removes the syscall from the auto-generation using assembly macros. It was based on previous pwrite/pwrite64 consolidation patch. The new macro SYSCALL_LL{64} is used to handle the offset argument and alias is created for __ASSUME_OFF_DIFF_OFF64 in case of pread64. Checked on x86_64, i386, aarch64, and powerpc64le. * misc/Makefile (CFLAGS-pwritev.c): New variable: add cancellation required flags. (CFLAGS-pwritev64.c): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c: Remove file. * sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/pwritev64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/pwritev.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/pwritev64.: Likwise. * sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list (pwritev): Remove syscall from auto-generation. * sysdeps/unix/sysv/linux/pwritev.c: Rewrite implementation. [WORDSIZE == 64] (pwritev64): Remove macro. [!PWRITEV] (PWRITEV): Likewise. [!PWRITEV] (PWRITEV_REPLACEMENT): Likewise. [!PWRITEV] (PWRITE): Likewise. [!PWRITEV] (OFF_T): Likewise. [!__ASSUME_PWRITEV] (PWRITEV_REPLACEMENT): Likewise. (LO_HI_LONG): Remove macro. [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev): Add function. * sysdeps/unix/sysv/linux/pwritev64.c: Rewrite implementation. (PWRITEV): Remove macro. (PWRITEV_REPLACEMENTE): Likewise. (PWRITE): Likewise. (OFF_T): Likewise. (pwritev64): New function. * nptl/tst-cancel4.c (tf_writev): Add test.
* * misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.Ulrich Drepper2009-04-031-0/+6
* misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for GLIBC_2.10. * misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64. * sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv and pwritev. * misc/preadv.c: New file. * misc/preadv64.c: New file. * misc/pwritev.c: New file. * misc/pwritev64.c: New file. * sysdeps/posx/preadv.c: New file. * sysdeps/posx/preadv64.c: New file. * sysdeps/posx/pwritev.c: New file. * sysdeps/posx/pwritev64.c: New file. * sysdeps/unix/sysv/linux/preadv.c: New file. * sysdeps/unix/sysv/linux/preadv64.c: New file. * sysdeps/unix/sysv/linux/pwritev.c: New file. * sysdeps/unix/sysv/linux/pwritev64.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.