Skip to content

Commit 0a3edba

Browse files
authored
Fix compilation on uClibc targets. (#982)
Patch by @spritetong! Fixes #980. Co-authored-by: Sprite Tong
1 parent 5648e33 commit 0a3edba

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/backend/libc/c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub(super) use libc::{pread64 as pread, pwrite64 as pwrite};
166166
#[cfg(any(target_os = "linux", target_os = "hurd", target_os = "emscripten"))]
167167
pub(super) use libc::{preadv64 as preadv, pwritev64 as pwritev};
168168

169-
#[cfg(all(target_os = "linux", target_env = "gnu"))]
169+
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]
170170
pub(super) unsafe fn prlimit(
171171
pid: libc::pid_t,
172172
resource: libc::__rlimit_resource_t,

src/backend/libc/conv.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ pub(super) fn ret_send_recv(len: i32) -> io::Result<usize> {
182182
not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")),
183183
any(
184184
target_os = "android",
185-
all(target_os = "linux", not(target_env = "musl"))
185+
all(
186+
target_os = "linux",
187+
not(target_env = "musl"),
188+
not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips")))
189+
)
186190
)
187191
))]
188192
#[inline]
@@ -201,7 +205,11 @@ pub(super) fn msg_iov_len(len: usize) -> c::size_t {
201205
)),
202206
not(any(
203207
target_os = "android",
204-
all(target_os = "linux", not(target_env = "musl"))
208+
all(
209+
target_os = "linux",
210+
not(target_env = "musl"),
211+
not(all(target_env = "uclibc", any(target_arch = "arm", target_arch = "mips")))
212+
)
205213
))
206214
))]
207215
#[inline]

0 commit comments

Comments
 (0)