Skip to content

Commit 9e5ecb6

Browse files
authored
Merge pull request #3762 from devnexen/gh3760
adding preadv2/pwritev2 to linux musl (1.2.5 min.)
2 parents 251a968 + 499ed57 commit 9e5ecb6

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

libc-test/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4307,6 +4307,9 @@ fn test_linux(target: &str) {
43074307
// FIXME: function pointers changed since Ubuntu 23.10
43084308
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
43094309

4310+
// Added in musl 1.2.5
4311+
"preadv2" | "pwritev2" if musl => true,
4312+
43104313
_ => false,
43114314
}
43124315
});

libc-test/semver/linux-musl.txt

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ PF_XDP
2323
PIDFD_NONBLOCK
2424
PR_SET_VMA
2525
PR_SET_VMA_ANON_NAME
26+
RWF_APPEND
27+
RWF_DSYNC
28+
RWF_HIPRI
29+
RWF_NOWAIT
30+
RWF_SYNC
2631
SOL_XDP
2732
XDP_SHARED_UMEM
2833
XDP_COPY
@@ -66,11 +71,13 @@ getloadavg
6671
lio_listio
6772
ntptimeval
6873
open_wmemstream
74+
preadv2
6975
preadv64
7076
prlimit
7177
prlimit64
7278
process_vm_readv
7379
process_vm_writev
80+
pwritev2
7481
pwritev64
7582
reallocarray
7683
timex

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

+20
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
671671
pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
672672
pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
673673

674+
pub const RWF_HIPRI: ::c_int = 0x00000001;
675+
pub const RWF_DSYNC: ::c_int = 0x00000002;
676+
pub const RWF_SYNC: ::c_int = 0x00000004;
677+
pub const RWF_NOWAIT: ::c_int = 0x00000008;
678+
pub const RWF_APPEND: ::c_int = 0x00000010;
679+
674680
pub const AF_IB: ::c_int = 27;
675681
pub const AF_MPLS: ::c_int = 28;
676682
pub const AF_NFC: ::c_int = 39;
@@ -862,6 +868,20 @@ extern "C" {
862868
dirfd: ::c_int,
863869
path: *const ::c_char,
864870
) -> ::c_int;
871+
pub fn preadv2(
872+
fd: ::c_int,
873+
iov: *const ::iovec,
874+
iovcnt: ::c_int,
875+
offset: ::off_t,
876+
flags: ::c_int,
877+
) -> ::ssize_t;
878+
pub fn pwritev2(
879+
fd: ::c_int,
880+
iov: *const ::iovec,
881+
iovcnt: ::c_int,
882+
offset: ::off_t,
883+
flags: ::c_int,
884+
) -> ::ssize_t;
865885
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
866886

867887
// Added in `musl` 1.1.20

0 commit comments

Comments
 (0)