Skip to content

Commit

Permalink
Fix compilation on uClibc targets.
Browse files Browse the repository at this point in the history
Patch by @spritetong!

Fixes #980.

Co-authored-by: Sprite Tong
  • Loading branch information
sunfishcode committed Jan 11, 2024
1 parent 5648e33 commit 85bef2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/libc/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub(super) use libc::{pread64 as pread, pwrite64 as pwrite};
#[cfg(any(target_os = "linux", target_os = "hurd", target_os = "emscripten"))]
pub(super) use libc::{preadv64 as preadv, pwritev64 as pwritev};

#[cfg(all(target_os = "linux", target_env = "gnu"))]
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]
pub(super) unsafe fn prlimit(
pid: libc::pid_t,
resource: libc::__rlimit_resource_t,
Expand Down
12 changes: 10 additions & 2 deletions src/backend/libc/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ pub(super) fn ret_send_recv(len: i32) -> io::Result<usize> {
not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")),
any(
target_os = "android",
all(target_os = "linux", not(target_env = "musl"))
all(
target_os = "linux",
not(target_env = "musl"),
not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips")))
)
)
))]
#[inline]
Expand All @@ -201,7 +205,11 @@ pub(super) fn msg_iov_len(len: usize) -> c::size_t {
)),
not(any(
target_os = "android",
all(target_os = "linux", not(target_env = "musl"))
all(
target_os = "linux",
not(target_env = "musl"),
not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips")))
)
))
))]
#[inline]
Expand Down

0 comments on commit 85bef2b

Please sign in to comment.