Skip to content

Commit

Permalink
Merge pull request #3762 from devnexen/gh3760
Browse files Browse the repository at this point in the history
adding preadv2/pwritev2 to linux musl (1.2.5 min.)
  • Loading branch information
JohnTitor authored Jun 30, 2024
2 parents 251a968 + 499ed57 commit 9e5ecb6
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 @@ -4307,6 +4307,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 @@ -66,11 +71,13 @@ getloadavg
lio_listio
ntptimeval
open_wmemstream
preadv2
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pwritev2
pwritev64
reallocarray
timex
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 @@ -671,6 +671,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 @@ -862,6 +868,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 9e5ecb6

Please sign in to comment.