Skip to content

Commit

Permalink
Replace hardcoded SIG_SETMASK with libc import
Browse files Browse the repository at this point in the history
This is available since libc-0.2.0 .
  • Loading branch information
l0kod committed Oct 16, 2016
1 parent 50972e4 commit e85ea62
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ use libc::{
// Common Extensions (SIGINFO and SIGEMT not in libc)
SIGIO,
SIGWINCH,

SIG_SETMASK,
};
use libc::kill;
use libc::getpid;
Expand Down Expand Up @@ -424,27 +426,6 @@ extern {

// Most of this was lifted out of rust-lang:rust/src/libstd/sys/unix/c.rs.

#[cfg(all(any(target_os = "linux", target_os = "android"),
any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "powerpc",
target_arch = "arm",
target_arch = "aarch64")))]
const SIG_SETMASK: libc::c_int = 2;

#[cfg(all(any(target_os = "linux", target_os = "android"),
any(target_arch = "mips", target_arch = "mipsel")))]
const SIG_SETMASK: libc::c_int = 3;

#[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
target_os = "netbsd",
target_os = "openbsd"))]
const SIG_SETMASK: libc::c_int = 3;

#[cfg(all(target_os = "linux", target_pointer_width = "32"))]
#[repr(C)]
struct sigset_t {
Expand Down

0 comments on commit e85ea62

Please sign in to comment.