Skip to content

Commit b4b5fbe

Browse files
authored
Merge pull request #3885 from tgross35/main-preadwritev2
[main] add preadv2/pwritev2 to linux musl (1.2.5 min.)
2 parents 535e82b + 889ad48 commit b4b5fbe

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
@@ -4318,6 +4318,9 @@ fn test_linux(target: &str) {
43184318
// FIXME: function pointers changed since Ubuntu 23.10
43194319
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
43204320

4321+
// Added in musl 1.2.5
4322+
"preadv2" | "pwritev2" if musl => true,
4323+
43214324
_ => false,
43224325
}
43234326
});

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
@@ -75,12 +80,14 @@ getutxline
7580
lio_listio
7681
ntptimeval
7782
open_wmemstream
83+
preadv2
7884
preadv64
7985
prlimit
8086
prlimit64
8187
process_vm_readv
8288
process_vm_writev
8389
pututxline
90+
pwritev2
8491
pwritev64
8592
reallocarray
8693
setutxent

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

+20
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,12 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
667667
pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
668668
pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;
669669

670+
pub const RWF_HIPRI: ::c_int = 0x00000001;
671+
pub const RWF_DSYNC: ::c_int = 0x00000002;
672+
pub const RWF_SYNC: ::c_int = 0x00000004;
673+
pub const RWF_NOWAIT: ::c_int = 0x00000008;
674+
pub const RWF_APPEND: ::c_int = 0x00000010;
675+
670676
pub const AF_IB: ::c_int = 27;
671677
pub const AF_MPLS: ::c_int = 28;
672678
pub const AF_NFC: ::c_int = 39;
@@ -857,6 +863,20 @@ extern "C" {
857863
dirfd: ::c_int,
858864
path: *const ::c_char,
859865
) -> ::c_int;
866+
pub fn preadv2(
867+
fd: ::c_int,
868+
iov: *const ::iovec,
869+
iovcnt: ::c_int,
870+
offset: ::off_t,
871+
flags: ::c_int,
872+
) -> ::ssize_t;
873+
pub fn pwritev2(
874+
fd: ::c_int,
875+
iov: *const ::iovec,
876+
iovcnt: ::c_int,
877+
offset: ::off_t,
878+
flags: ::c_int,
879+
) -> ::ssize_t;
860880
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
861881

862882
// Added in `musl` 1.1.20

0 commit comments

Comments
 (0)