Skip to content

Commit ec99a98

Browse files
committed
unix: add preadv2 and pwritev2 unix-wide.
Add preadv2 and pwrite2 to linux and Android, making majority of linux_like based systems have support, to allow using the new flags introduced in #4452. Move definitions to linux_like/mod.rs instead of each separate system alone.
1 parent dbd7ad9 commit ec99a98

4 files changed

Lines changed: 18 additions & 30 deletions

File tree

libc-test/semver/android.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,6 +3753,7 @@ prctl
37533753
pread
37543754
pread64
37553755
preadv
3756+
preadv2
37563757
preadv64
37573758
printf
37583759
prlimit
@@ -3856,6 +3857,7 @@ puts
38563857
pwrite
38573858
pwrite64
38583859
pwritev
3860+
pwritev2
38593861
pwritev64
38603862
qsort
38613863
raise

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,22 +1029,6 @@ extern "C" {
10291029
dirfd: c_int,
10301030
path: *const c_char,
10311031
) -> c_int;
1032-
#[cfg_attr(gnu_file_offset_bits64, link_name = "preadv64v2")]
1033-
pub fn preadv2(
1034-
fd: c_int,
1035-
iov: *const crate::iovec,
1036-
iovcnt: c_int,
1037-
offset: off_t,
1038-
flags: c_int,
1039-
) -> ssize_t;
1040-
#[cfg_attr(gnu_file_offset_bits64, link_name = "pwritev64v2")]
1041-
pub fn pwritev2(
1042-
fd: c_int,
1043-
iov: *const crate::iovec,
1044-
iovcnt: c_int,
1045-
offset: off_t,
1046-
flags: c_int,
1047-
) -> ssize_t;
10481032
pub fn preadv64v2(
10491033
fd: c_int,
10501034
iov: *const crate::iovec,

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -780,20 +780,6 @@ extern "C" {
780780
dirfd: c_int,
781781
path: *const c_char,
782782
) -> c_int;
783-
pub fn preadv2(
784-
fd: c_int,
785-
iov: *const crate::iovec,
786-
iovcnt: c_int,
787-
offset: off_t,
788-
flags: c_int,
789-
) -> ssize_t;
790-
pub fn pwritev2(
791-
fd: c_int,
792-
iov: *const crate::iovec,
793-
iovcnt: c_int,
794-
offset: off_t,
795-
flags: c_int,
796-
) -> ssize_t;
797783
pub fn getauxval(type_: c_ulong) -> c_ulong;
798784
pub fn renameat2(
799785
olddirfd: c_int,

src/unix/linux_like/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,22 @@ extern "C" {
20932093
buflen: size_t,
20942094
result: *mut *mut passwd,
20952095
) -> c_int;
2096+
#[cfg_attr(gnu_file_offset_bits64, link_name = "preadv64v2")]
2097+
pub fn preadv2(
2098+
fd: c_int,
2099+
iov: *const crate::iovec,
2100+
iovcnt: c_int,
2101+
offset: off_t,
2102+
flags: c_int,
2103+
) -> ssize_t;
2104+
#[cfg_attr(gnu_file_offset_bits64, link_name = "pwritev64v2")]
2105+
pub fn pwritev2(
2106+
fd: c_int,
2107+
iov: *const crate::iovec,
2108+
iovcnt: c_int,
2109+
offset: off_t,
2110+
flags: c_int,
2111+
) -> ssize_t;
20962112
}
20972113

20982114
// LFS64 extensions

0 commit comments

Comments
 (0)