Skip to content

Commit 889ad48

Browse files
dcarliertgross35
dcarlier
authored andcommitted
adding preadv2/pwritev2 to linux musl (1.2.5 min.)
close rust-lang#3760 (apply <rust-lang#3762> to `main`) [ resolve conflicts - Trevor ] (cherry picked from commit 499ed57)
1 parent 5431bdb commit 889ad48

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,9 @@ fn test_linux(target: &str) {
43114311
// FIXME: function pointers changed since Ubuntu 23.10
43124312
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,
43134313

4314+
// Added in musl 1.2.5
4315+
"preadv2" | "pwritev2" if musl => true,
4316+
43144317
_ => false,
43154318
}
43164319
});

libc-test/semver/linux-musl.txt

Lines changed: 7 additions & 0 deletions
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

Lines changed: 20 additions & 0 deletions
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)