diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-04-25 16:43:27 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-05-31 17:35:46 -0300 |
commit | 52bd9381692fd23df859fd0e564af247b1571557 (patch) | |
tree | c3dd6e30951eaf7b5de7c8cc0628ad74048d2ad9 /sysdeps/unix | |
parent | cfa9bb61cd09c40def96f042a3123ec0093c4ad0 (diff) | |
download | glibc-52bd9381692fd23df859fd0e564af247b1571557.tar glibc-52bd9381692fd23df859fd0e564af247b1571557.tar.gz glibc-52bd9381692fd23df859fd0e564af247b1571557.tar.bz2 glibc-52bd9381692fd23df859fd0e564af247b1571557.zip |
posix: Implement preadv2 and pwritev2
This patch adds support of preadv2 and pwritev2 which are similar to
preadv/pwritev but with an extra flag argument. As for preadv/pwritev
both interfaces are added a non-standard GNU API.
For default 'posix' implementation trying to emulate the Linux supported
flags is troublesome:
* We can not temporary change the file state of the O_DSYNC and O_SYNC
flags to emulate RWF_{D}SYNC (attempts to change the state of using
fcntl are silently ignored).
* IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
semantic not provided by any other flag (O_NONBLOCK for instance).
So default sysdeps/posix implementations fails with EOPNOTSUPP for any non
supported flag (which are none currently) calls generic preadv/pwritev.
Basically this implementation supports only preadv2 called as preadv (with
flags sets to 0).
The Linux one uses the preadv2/pwritev2 syscall if defined, otherwise it
call preadv/writev. Instead of using the previous __ASSUME_* to
unconditionally issue the syscall (and avoid building the fallback routine),
it call pread/write if the preadv2/pwritev2 syscalls fails. The idea
is just avoid adding another __ASSUME_* and checking each architecture
on every kernel bump and simplify code conditionals.
Checked on x86_64-linux-gnu and on i686-linux-gnu and a check with
run-built-tests=no on aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips{64,64n32}-linux-gnu,
nios2-linux-gnu, powerpc{64,64le}-linux-gnu, s390{x}-linux-gnu,
sparc{64,v9}-linux-gnu, tile{gx,pro}-linux-gnu, and sh4-linux-gnu (all using
gcc 6.3).
* NEWS: Add note about pwritev2 and preadv2 inclusion.
* misc/Makefile (routines): Add preadv2, preadv64v2, pwritev2, and
pwritev64v2.
(tests): Add tst-preadvwritev2 and tst-preadvwritev64v2.
* misc/Versions (GLIBC_2.26): Add preadv2, preadv64v2, pwritev2, and
pwritev64v2.
* misc/preadv2.c: New file.
* misc/preadv64v2.c: Likewise.
* misc/pwritev2.c: Likewise.
* misc/pwritev64v2.c: Likewise.
* misc/tst-preadvwritev2.c: Likewise.
* misc/tst-preadvwritev64v2.c: Likewise.
* manual/llio.texi: Add preadv2 and pwritev2 documentation.
* misc/sys/uio.h [__USE_GNU && !__USE_FILE_OFFSET64] (preadv2): New
prototype.
[__USE_GNU && !__USE_FILE_OFFSET64] (pwritev2): Likewise.
[__USE_GNU && __USE_FILE_OFFSET64] (preadv64v2): Likewise.
[__USE_GNU && __USE_FILE_OFFSET64] (pwritev64v2): Likewise.
* misc/tst-preadvwritev-common.c (PREADV): Define if not defined.
(PWRITEV): Likewise.
(do_test_with_offset): Use PREADV and PWRITEV macros and check for
ENOSYS.
* nptl/tst-cancel4.c (tf_pwritev2): New test.
(tf_preadv2): Likewise.
(tf_fsync): Add tf_pwritev2 and tf_preadv2.
* sysdeps/posix/preadv2.c: Likewise.
* sysdeps/posix/preadv64v2.c: Likewise.
* sysdeps/posix/pwritev2.c: Likewise.
* sysdeps/posix/pwritev64v2.c: Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h: Add comment for syscall
support in kernel.
* sysdeps/unix/sysv/linux/preadv2.c: Likewise.
* sysdeps/unix/sysv/linux/preadv64v2.c: Likewise.
* sysdeps/unix/sysv/linux/pwritev2.c: Likewise.
* sysdeps/unix/sysv/linux/pwritev64v2.c: Likewise.
* sysdeps/unix/sysv/linux/preadv.c (preadv): Add libc_hidden_def.
* 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/bits/uio.h: Add supported preadv2/pwritev2
support flags on Linux.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist (GLIBC_2.26): Add
preadv2, preadv64v2, pwritev2, pwritev64v2.
* sysdeps/unix/sysv/linux/alpha/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/arm/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/hppa/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/i386/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/ia64/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/microblaze/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/nios2/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
(GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
(GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
(GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/sh/libc.abilist (GLIBC_2.26): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/sysv/linux/tile/tilegx/tilegx32/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/sysv/linux/tile/tilegx/tilegx64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist (GLIBC_2.26):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist (GLIBC_2.26):
Likewise.
Diffstat (limited to 'sysdeps/unix')
39 files changed, 348 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index a494c3947d..81e4fe9d9c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2098,4 +2098,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 2fc1a9bae7..fab73317ca 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2009,6 +2009,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist index 4465a62ff1..d2a206a8df 100644 --- a/sysdeps/unix/sysv/linux/arm/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/libc.abilist @@ -99,6 +99,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h index 1583f0455b..d5701f8171 100644 --- a/sysdeps/unix/sysv/linux/bits/uio.h +++ b/sysdeps/unix/sysv/linux/bits/uio.h @@ -69,4 +69,10 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, __END_DECLS # endif + +/* Flags for preadv2/pwritev2: */ +#define RWF_HIPRI 0x00000001 /* High priority request. */ +#define RWF_DSYNC 0x00000002 /* per-IO O_DSYNC. */ +#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */ + #endif diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 96126d9e6a..24bb7300d3 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1863,6 +1863,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index aae351bbff..2ff1998ac9 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2021,6 +2021,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 81ec65bec0..39ccf2b5ee 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1885,6 +1885,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 8961e4dd78..9495db4fef 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -97,3 +97,8 @@ /* Support for SysV IPC through wired syscalls. All supported architectures either support ipc syscall and/or all the ipc correspondent syscalls. */ #define __ASSUME_DIRECT_SYSVIPC_SYSCALLS 1 + +/* Support for p{read,write}v2 was added in 4.6. However Linux default + implementation does not assume the __ASSUME_* and instead use a fallback + implementation based on p{read,write}v and returning an error for + non supported flags. */ diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 9db205b68e..b594ebd7c6 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -100,6 +100,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index ee59e950b6..a36739d41c 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -1977,6 +1977,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist index feb869757c..16aa25485f 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist @@ -2098,4 +2098,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index a5b1c42929..907ab331f2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -1952,6 +1952,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 570a859aac..36ee235d71 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -1950,6 +1950,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 71008ad873..783aa73ab7 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -1948,6 +1948,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 1a07d66caf..e1275dfe28 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -1943,6 +1943,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index a62a41be62..be252287d1 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2139,4 +2139,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index f4f11dc625..e213895c71 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -1981,6 +1981,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 2977569f2c..d25aefd1ae 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -1986,6 +1986,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist index 271d32e19b..443d89f663 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist @@ -2186,4 +2186,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist index 372ef67c27..5eb056baf5 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist @@ -100,6 +100,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 _Exit F diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c index 7d971cc7b3..ecabc8c9c6 100644 --- a/sysdeps/unix/sysv/linux/preadv.c +++ b/sysdeps/unix/sysv/linux/preadv.c @@ -50,4 +50,6 @@ preadv (int fd, const struct iovec *vector, int count, off_t offset) # define OFF_T off_t # include <sysdeps/posix/preadv_common.c> # endif /* __ASSUME_PREADV */ + +libc_hidden_def (preadv) #endif diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c new file mode 100644 index 0000000000..11fe85eaa8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/preadv2.c @@ -0,0 +1,55 @@ +/* Linux implementation of preadv2. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <sysdep-cancel.h> + +#ifndef __OFF_T_MATCHES_OFF64_T + +# if !defined (__NR_preadv2) && defined (__NR_pread64v2) +# define __NR_preadv2 __NR_pread64v2 +# endif + +ssize_t +preadv2 (int fd, const struct iovec *vector, int count, off_t offset, + int flags) +{ +# ifdef __NR_preadv2 + ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count, + LO_HI_LONG (offset), flags); + if (result >= 0 || errno != ENOSYS) + return result; +# endif + /* Trying to emulate the preadv2 syscall flags is troublesome: + + * We can not temporary change the file state of the O_DSYNC and O_SYNC + flags to emulate RWF_{D}SYNC (attempts to change the state of using + fcntl are silently ignored). + + * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal + semantic not provided by any other flag (O_NONBLOCK for instance). */ + + if (flags != 0) + { + __set_errno (EOPNOTSUPP); + return -1; + } + return preadv (fd, vector, count, offset); +} + +#endif diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c index 66daa74ded..c96b2142e3 100644 --- a/sysdeps/unix/sysv/linux/preadv64.c +++ b/sysdeps/unix/sysv/linux/preadv64.c @@ -48,7 +48,9 @@ preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) # define OFF_T off64_t # include <sysdeps/posix/preadv_common.c> #endif +libc_hidden_def (preadv64) #ifdef __OFF_T_MATCHES_OFF64_T strong_alias (preadv64, preadv) +libc_hidden_def (preadv) #endif diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c new file mode 100644 index 0000000000..9d7f8c9893 --- /dev/null +++ b/sysdeps/unix/sysv/linux/preadv64v2.c @@ -0,0 +1,55 @@ +/* Linux implementation of preadv2 (LFS version). + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <sysdep-cancel.h> + +#if !defined(__NR_preadv64v2) && defined(__NR_preadv2) +# define __NR_preadv64v2 __NR_preadv2 +#endif + +ssize_t +preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset, + int flags) +{ +#ifdef __NR_preadv64v2 + ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count, + LO_HI_LONG (offset), flags); + if (result >= 0 || errno != ENOSYS) + return result; +#endif + /* Trying to emulate the preadv2 syscall flags is troublesome: + + * We can not temporary change the file state of the O_DSYNC and O_SYNC + flags to emulate RWF_{D}SYNC (attempts to change the state of using + fcntl are silently ignored). + + * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal + semantic not provided by any other flag (O_NONBLOCK for instance). */ + + if (flags != 0) + { + __set_errno (EOPNOTSUPP); + return -1; + } + return preadv64 (fd, vector, count, offset); +} + +#ifdef __OFF_T_MATCHES_OFF64_T +strong_alias (preadv64v2, preadv2) +#endif diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c index 57e5d20328..71959c0de2 100644 --- a/sysdeps/unix/sysv/linux/pwrite64.c +++ b/sysdeps/unix/sysv/linux/pwrite64.c @@ -28,6 +28,7 @@ __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) { return SYSCALL_CANCEL (pwrite64, fd, buf, count, SYSCALL_LL64_PRW (offset)); } + weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c index ce02996a0b..7545cb3e1e 100644 --- a/sysdeps/unix/sysv/linux/pwritev.c +++ b/sysdeps/unix/sysv/linux/pwritev.c @@ -50,4 +50,6 @@ pwritev (int fd, const struct iovec *vector, int count, off_t offset) # define OFF_T off_t # include <sysdeps/posix/pwritev_common.c> # endif /* __ASSUME_PREADV */ + +libc_hidden_def (pwritev) #endif diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c new file mode 100644 index 0000000000..72f0471f96 --- /dev/null +++ b/sysdeps/unix/sysv/linux/pwritev2.c @@ -0,0 +1,51 @@ +/* Linux implementation of pwritev2. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <sysdep-cancel.h> + +#ifndef __OFF_T_MATCHES_OFF64_T + +ssize_t +pwritev2 (int fd, const struct iovec *vector, int count, off_t offset, + int flags) +{ +# ifdef __NR_pwritev2 + ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count, + LO_HI_LONG (offset), flags); + if (result >= 0 || errno != ENOSYS) + return result; +# endif + /* Trying to emulate the pwritev2 syscall flags is troublesome: + + * We can not temporary change the file state of the O_DSYNC and O_SYNC + flags to emulate RWF_{D}SYNC (attempts to change the state of using + fcntl are silently ignored). + + * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal + semantic not provided by any other flag (O_NONBLOCK for instance). */ + + if (flags != 0) + { + __set_errno (EOPNOTSUPP); + return -1; + } + return pwritev (fd, vector, count, offset); +} + +#endif diff --git a/sysdeps/unix/sysv/linux/pwritev64.c b/sysdeps/unix/sysv/linux/pwritev64.c index 45fb90b0d7..9dc4e55f96 100644 --- a/sysdeps/unix/sysv/linux/pwritev64.c +++ b/sysdeps/unix/sysv/linux/pwritev64.c @@ -48,7 +48,9 @@ pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) # define OFF_T off64_t # include <sysdeps/posix/pwritev_common.c> #endif +libc_hidden_def (pwritev64) #ifdef __OFF_T_MATCHES_OFF64_T strong_alias (pwritev64, pwritev) +libc_hidden_def (pwritev) #endif diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c new file mode 100644 index 0000000000..def9a0bc57 --- /dev/null +++ b/sysdeps/unix/sysv/linux/pwritev64v2.c @@ -0,0 +1,55 @@ +/* Linux implementation of pwritev2 (LFS version). + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> +#include <sysdep-cancel.h> + +#if !defined(__NR_pwritev64v2) && defined(__NR_pwritev2) +# define __NR_pwritev64v2 __NR_pwritev2 +#endif + +ssize_t +pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset, + int flags) +{ +#ifdef __NR_pwritev64v2 + ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count, + LO_HI_LONG (offset), flags); + if (result >= 0 || errno != ENOSYS) + return result; +#endif + /* Trying to emulate the pwritev2 syscall flags is troublesome: + + * We can not temporary change the file state of the O_DSYNC and O_SYNC + flags to emulate RWF_{D}SYNC (attempts to change the state of using + fcntl are silently ignored). + + * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal + semantic not provided by any other flag (O_NONBLOCK for instance). */ + + if (flags != 0) + { + __set_errno (EOPNOTSUPP); + return -1; + } + return pwritev64 (fd, vector, count, offset); +} + +#ifdef __OFF_T_MATCHES_OFF64_T +strong_alias (pwritev64v2, pwritev2) +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 705ff851a9..63d33e8b37 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -1981,6 +1981,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 21fd2b5671..b1b2b29c94 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1882,6 +1882,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist index 313a71e589..f3a70a0f6f 100644 --- a/sysdeps/unix/sysv/linux/sh/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/libc.abilist @@ -1867,6 +1867,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 94a4fb2213..8c4c2e502c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -1973,6 +1973,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 6db5811c3f..1653164d9e 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1911,6 +1911,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist index 5d83926aac..41647d4610 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist @@ -2105,4 +2105,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist index ce14ceb15f..1088923e59 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist @@ -2105,4 +2105,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist index 5d83926aac..41647d4610 100644 --- a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist @@ -2105,4 +2105,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index f69de7aa83..513524d932 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1862,6 +1862,10 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index a330855308..0c557e9f43 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2105,4 +2105,8 @@ GLIBC_2.25 strfromd F GLIBC_2.25 strfromf F GLIBC_2.25 strfroml F GLIBC_2.26 GLIBC_2.26 A +GLIBC_2.26 preadv2 F +GLIBC_2.26 preadv64v2 F +GLIBC_2.26 pwritev2 F +GLIBC_2.26 pwritev64v2 F GLIBC_2.26 reallocarray F |