Auto merge of #2066 - wmanley:preadv2-pwritev2, r=JohnTitor

Linux: Add `preadv2` and `pwritev2` and associated constants

These functions are the same as `preadv` and `pwritev` but have a flags
parameter.  `preadv2()` and `pwritev2()` first appeared in Linux 4.6.
Library support was added in glibc 2.26.

See the definition of the constants in [linux/fs.h](fcadab7404/tools/include/uapi/linux/fs.h (L288-L301)).
This commit is contained in:
bors 2021-02-12 05:14:49 +00:00
commit a61fd8c79c
1 changed files with 23 additions and 0 deletions

View File

@ -862,6 +862,15 @@ pub const EPOLLWAKEUP: ::c_int = 0x20000000;
pub const SEEK_DATA: ::c_int = 3;
pub const SEEK_HOLE: ::c_int = 4;
// linux/fs.h
// Flags for preadv2/pwritev2
pub const RWF_HIPRI: ::c_int = 0x00000001;
pub const RWF_DSYNC: ::c_int = 0x00000002;
pub const RWF_SYNC: ::c_int = 0x00000004;
pub const RWF_NOWAIT: ::c_int = 0x00000008;
pub const RWF_APPEND: ::c_int = 0x00000010;
// linux/rtnetlink.h
pub const TCA_PAD: ::c_ushort = 9;
pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
@ -1423,6 +1432,20 @@ extern "C" {
dirfd: ::c_int,
path: *const ::c_char,
) -> ::c_int;
pub fn preadv2(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn pwritev2(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off_t,
flags: ::c_int,
) -> ::ssize_t;
}
extern "C" {