Skip to content

Commit 877fb71

Browse files
committed
Auto merge of #513 - yxd-hde:fix-musl, r=posborne
Fix unresolved name error when building with musl. See: https://git.musl-libc.org/cgit/musl/tree/src/time/timer_create.c#n126
2 parents e7629f3 + 3a89d2d commit 877fb71

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sys/signal.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,12 @@ impl SigEvent {
465465
SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL,
466466
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
467467
SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT,
468-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
469-
SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID
468+
#[cfg(target_os = "freebsd")]
469+
SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
470+
#[cfg(all(target_os = "linux", target_env = "gnu"))]
471+
SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID,
472+
#[cfg(all(target_os = "linux", target_env = "musl"))]
473+
SigevNotify::SigevThreadId{..} => 4 // No SIGEV_THREAD_ID defined
470474
};
471475
sev.sigev_signo = match sigev_notify {
472476
SigevNotify::SigevSignal{ signal, .. } => signal as ::c_int,

0 commit comments

Comments
 (0)