Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding preadv2/pwritev2 to linux musl (1.2.5 min.) #3762

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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