Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions signal-hook-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ use libc::{c_int, c_void, sigaction, siginfo_t};
use libc::{c_int, sighandler_t};

#[cfg(not(windows))]
use libc::{SIGFPE, SIGILL, SIGKILL, SIGSEGV, SIGSTOP};
use libc::{SIGBUS, SIGFPE, SIGILL, SIGKILL, SIGSEGV, SIGSTOP};
#[cfg(windows)]
use libc::{SIGFPE, SIGILL, SIGSEGV};
use libc::{SIGBUS, SIGFPE, SIGILL, SIGSEGV};

use half_lock::HalfLock;

Expand Down Expand Up @@ -387,9 +387,9 @@ extern "C" fn handler(sig: c_int, info: *mut siginfo_t, data: *mut c_void) {
pub const FORBIDDEN: &[c_int] = FORBIDDEN_IMPL;

#[cfg(windows)]
const FORBIDDEN_IMPL: &[c_int] = &[SIGILL, SIGFPE, SIGSEGV];
const FORBIDDEN_IMPL: &[c_int] = &[SIGILL, SIGFPE, SIGSEGV, SIGBUS];
#[cfg(not(windows))]
const FORBIDDEN_IMPL: &[c_int] = &[SIGKILL, SIGSTOP, SIGILL, SIGFPE, SIGSEGV];
const FORBIDDEN_IMPL: &[c_int] = &[SIGKILL, SIGSTOP, SIGILL, SIGFPE, SIGSEGV, SIGBUS];

/// Registers an arbitrary action for the given signal.
///
Expand All @@ -412,6 +412,7 @@ const FORBIDDEN_IMPL: &[c_int] = &[SIGKILL, SIGSTOP, SIGILL, SIGFPE, SIGSEGV];
/// * `SIGILL`
/// * `SIGFPE`
/// * `SIGSEGV`
/// * `SIGBUS`
///
/// The first two are not possible to override (and the underlying C functions simply ignore all
/// requests to do so, which smells of possible bugs, or return errors). The rest can be set, but
Expand Down