Skip to content

Commit

Permalink
adding preadv2/pwritev2 to linux musl (1.2.5 min.)
Browse files Browse the repository at this point in the history
close #3760

(apply <#3762> to `main`)
[ resolve conflicts - Trevor ]
(cherry picked from commit 499ed57)
  • Loading branch information
dcarlier authored and tgross35 committed Aug 29, 2024
1 parent 5431bdb commit 889ad48
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4311,6 +4311,9 @@ fn test_linux(target: &str) {
// FIXME: function pointers changed since Ubuntu 23.10
"strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true,

// Added in musl 1.2.5
"preadv2" | "pwritev2" if musl => true,

_ => false,
}
});
Expand Down
7 changes: 7 additions & 0 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ PF_XDP
PIDFD_NONBLOCK
PR_SET_VMA
PR_SET_VMA_ANON_NAME
RWF_APPEND
RWF_DSYNC
RWF_HIPRI
RWF_NOWAIT
RWF_SYNC
SOL_XDP
XDP_SHARED_UMEM
XDP_COPY
Expand Down Expand Up @@ -75,12 +80,14 @@ getutxline
lio_listio
ntptimeval
open_wmemstream
preadv2
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pututxline
pwritev2
pwritev64
reallocarray
setutxent
Expand Down
20 changes: 20 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,12 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
pub const PTRACE_GETSIGMASK: ::c_uint = 0x420a;
pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b;

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;

pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
Expand Down Expand Up @@ -857,6 +863,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;
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;

// Added in `musl` 1.1.20
Expand Down

0 comments on commit 889ad48

Please sign in to comment.