Skip to content

Commit 6844cfb

Browse files
committed
Add OpenBSD compatibility to singals
1 parent fc5f879 commit 6844cfb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sys/signal.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,13 @@ pub enum SigevNotify {
490490

491491
/// Used to request asynchronous notification of the completion of certain
492492
/// events, such as POSIX AIO and timers.
493+
#[cfg(not(target_os = "openbsd"))]
493494
#[repr(C)]
494495
pub struct SigEvent {
495496
sigevent: libc::sigevent
496497
}
497498

499+
#[cfg(not(target_os = "openbsd"))]
498500
impl SigEvent {
499501
// Note: this constructor does not allow the user to set the
500502
// sigev_notify_kevent_flags field. That's considered ok because on FreeBSD
@@ -559,6 +561,7 @@ impl SigEvent {
559561
}
560562
}
561563

564+
#[cfg(not(target_os = "openbsd"))]
562565
impl Debug for SigEvent {
563566
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
564567
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
@@ -581,6 +584,7 @@ impl Debug for SigEvent {
581584
}
582585
}
583586

587+
#[cfg(not(target_os = "openbsd"))]
584588
impl<'a> From<&'a libc::sigevent> for SigEvent {
585589
fn from(sigevent: &libc::sigevent) -> Self {
586590
SigEvent{ sigevent: sigevent.clone() }

0 commit comments

Comments
 (0)