Auto merge of #671 - Susurrus:signalfd_android, r=alexcrichton

Add signalfd and related to android
This commit is contained in:
bors 2017-07-20 19:05:46 +00:00
commit 516df7f773
2 changed files with 27 additions and 1 deletions

View File

@ -173,7 +173,6 @@ fn main() {
if linux {
cfg.header("mqueue.h");
cfg.header("ucontext.h");
cfg.header("sys/signalfd.h");
if !uclibc {
// optionally included in uclibc
cfg.header("sys/xattr.h");
@ -201,6 +200,7 @@ fn main() {
cfg.header("sys/eventfd.h");
cfg.header("sys/prctl.h");
cfg.header("sys/sendfile.h");
cfg.header("sys/signalfd.h");
cfg.header("sys/vfs.h");
cfg.header("sys/syscall.h");
cfg.header("sys/personality.h");

View File

@ -146,6 +146,27 @@ s! {
#[cfg(target_pointer_width = "64")]
__f_reserved: [u32; 6],
}
pub struct signalfd_siginfo {
pub ssi_signo: ::uint32_t,
pub ssi_errno: ::int32_t,
pub ssi_code: ::int32_t,
pub ssi_pid: ::uint32_t,
pub ssi_uid: ::uint32_t,
pub ssi_fd: ::int32_t,
pub ssi_tid: ::uint32_t,
pub ssi_band: ::uint32_t,
pub ssi_overrun: ::uint32_t,
pub ssi_trapno: ::uint32_t,
pub ssi_status: ::int32_t,
pub ssi_int: ::int32_t,
pub ssi_ptr: ::c_ulonglong,
pub ssi_utime: ::c_ulonglong,
pub ssi_stime: ::c_ulonglong,
pub ssi_addr: ::c_ulonglong,
pub ssi_addr_lsb: ::uint16_t,
_pad: [::uint8_t; 46],
}
}
pub const O_TRUNC: ::c_int = 512;
@ -809,6 +830,9 @@ pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
pub const SFD_CLOEXEC: ::c_int = O_CLOEXEC;
pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK;
f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.__bits.iter_mut() {
@ -888,6 +912,8 @@ extern {
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
len: ::off_t) -> ::c_int;
pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int)
-> ::c_int;
}
cfg_if! {