summaryrefslogtreecommitdiff
path: root/src/sys/signal.rs
diff options
context:
space:
mode:
authorJonah Petri <jonah@petri.us>2021-12-07 16:57:52 -0500
committerJonah Petri <jonah@petri.us>2022-01-24 10:06:35 -0500
commit6c4b9133f14d4488dc1b86411568b49e99fbe629 (patch)
treeec06e25f28ac2f989b1af4408d00407b9e548258 /src/sys/signal.rs
parentae2b7b3552f3b800ab0f5e92dad06cd2e7df25e6 (diff)
downloadnix-6c4b9133f14d4488dc1b86411568b49e99fbe629.zip
uclibc support
Diffstat (limited to 'src/sys/signal.rs')
-rw-r--r--src/sys/signal.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index 9750d890..ddc02483 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -11,6 +11,7 @@ use std::str::FromStr;
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
use std::os::unix::io::RawFd;
use std::ptr;
+use cfg_if::cfg_if;
#[cfg(not(any(target_os = "openbsd", target_os = "redox")))]
#[cfg(any(feature = "aio", feature = "signal"))]
@@ -420,10 +421,15 @@ pub const SIGPOLL : Signal = SIGIO;
/// Alias for [`SIGSYS`]
pub const SIGUNUSED : Signal = SIGSYS;
-#[cfg(not(target_os = "redox"))]
-type SaFlags_t = libc::c_int;
-#[cfg(target_os = "redox")]
-type SaFlags_t = libc::c_ulong;
+cfg_if! {
+ if #[cfg(target_os = "redox")] {
+ type SaFlags_t = libc::c_ulong;
+ } else if #[cfg(target_env = "uclibc")] {
+ type SaFlags_t = libc::c_ulong;
+ } else {
+ type SaFlags_t = libc::c_int;
+ }
+}
}
#[cfg(feature = "signal")]
@@ -1046,6 +1052,8 @@ mod sigevent {
SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
#[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))]
SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
+ #[cfg(all(target_os = "linux", target_env = "uclibc"))]
+ SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
#[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))]
SigevNotify::SigevThreadId{..} => 4 // No SIGEV_THREAD_ID defined
};