From d3ae806bef3392d66c4a49137798e71b9ce8c939 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 15 Sep 2023 14:30:32 -0700 Subject: [PATCH] Fix the type of `_RawOpcode` on uclibc. (#828) Apply a patch from @spritetong to fix the type of `_RawOpcode` on uclibc. Fixes #827. --- src/ioctl/mod.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ioctl/mod.rs b/src/ioctl/mod.rs index 61a08b8e1..aaaf584e2 100644 --- a/src/ioctl/mod.rs +++ b/src/ioctl/mod.rs @@ -293,12 +293,21 @@ pub type RawOpcode = _RawOpcode; #[cfg(linux_raw)] type _RawOpcode = c::c_uint; -// On libc Linux with GNU libc, this is an unsigned long. -#[cfg(all(not(linux_raw), target_os = "linux", target_env = "gnu"))] +// On libc Linux with GNU libc or uclibc, this is an unsigned long. +#[cfg(all( + not(linux_raw), + target_os = "linux", + any(target_env = "gnu", target_env = "uclibc") +))] type _RawOpcode = c::c_ulong; // Musl uses a c_int -#[cfg(all(not(linux_raw), target_os = "linux", not(target_env = "gnu")))] +#[cfg(all( + not(linux_raw), + target_os = "linux", + not(target_env = "gnu"), + not(target_env = "uclibc") +))] type _RawOpcode = c::c_int; // Android uses c_int