diff --git a/src/header/signal/linux.rs b/src/header/signal/linux.rs index d056b105f9b1d28b0a7d3f2ab09640a230158525..cfa63b556353681d4a988bd340a417883c77b011 100644 --- a/src/header/signal/linux.rs +++ b/src/header/signal/linux.rs @@ -54,6 +54,7 @@ pub const SIGPOLL: usize = SIGIO; pub const SIGPWR: usize = 30; pub const SIGSYS: usize = 31; pub const SIGUNUSED: usize = SIGSYS; +pub const NSIG: usize = 32; pub const SA_NOCLDSTOP: usize = 1; pub const SA_NOCLDWAIT: usize = 2; diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs index 04200a039604a7c7c7638dee34d29bf9af84f219..8bb133bb01733ddb6a33d4e246ef15b1a99649b5 100644 --- a/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs @@ -36,7 +36,6 @@ pub struct sigaction { pub sa_mask: sigset_t, } -pub const NSIG: usize = 64; pub type sigset_t = c_ulong; #[no_mangle] diff --git a/src/header/signal/redox.rs b/src/header/signal/redox.rs index 331997d1dbebbcaf2e6ea3dde075e09a3b83c90d..e13787ee868639010b1e52466a98313a3f5cb6be 100644 --- a/src/header/signal/redox.rs +++ b/src/header/signal/redox.rs @@ -51,6 +51,7 @@ pub const SIGWINCH: usize = 28; pub const SIGIO: usize = 29; pub const SIGPWR: usize = 30; pub const SIGSYS: usize = 31; +pub const NSIG: usize = 32; pub const SA_NOCLDSTOP: usize = 0x00000001; pub const SA_NOCLDWAIT: usize = 0x00000002; diff --git a/src/header/sys_time/mod.rs b/src/header/sys_time/mod.rs index a57a9675614bf9888c225cc46854db08c0167a0d..c961a7a42c6e99b39d3b25792f804ed1cc2a8e56 100644 --- a/src/header/sys_time/mod.rs +++ b/src/header/sys_time/mod.rs @@ -53,17 +53,6 @@ pub extern "C" fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int { Sys::gettimeofday(tp, tzp) } -// #[no_mangle] -pub extern "C" fn select( - nfds: c_int, - readfds: *mut fd_set, - writefds: *mut fd_set, - errorfds: *mut fd_set, - timeout: *mut timeval, -) -> c_int { - unimplemented!(); -} - #[no_mangle] pub unsafe extern "C" fn utimes(path: *const c_char, times: *const timeval) -> c_int { let path = CStr::from_ptr(path); @@ -79,10 +68,3 @@ pub unsafe extern "C" fn utimes(path: *const c_char, times: *const timeval) -> c ]; Sys::utimens(path, times_spec.as_ptr()) } - -/* -#[no_mangle] -pub extern "C" fn func(args) -> c_int { - unimplemented!(); -} -*/ diff --git a/src/platform/redox/signal.rs b/src/platform/redox/signal.rs index d070ff249226bd0cf1f1bad70c20879e1accc4b8..1779505d1cafe1cfae88042aac84a613e68474bf 100644 --- a/src/platform/redox/signal.rs +++ b/src/platform/redox/signal.rs @@ -7,7 +7,7 @@ use super::super::{Pal, PalSignal}; use super::{e, Sys}; use header::errno::EINVAL; use header::signal::{sigaction, sigset_t}; -use header::sys_time::itimerval; +use header::sys_time::{ITIMER_REAL, itimerval}; impl PalSignal for Sys { fn getitimer(which: c_int, out: *mut itimerval) -> c_int { @@ -20,7 +20,7 @@ impl PalSignal for Sys { }; let fd = e(syscall::open(path, syscall::O_RDONLY | syscall::O_CLOEXEC)); - if fd < 0 { + if fd == !0 { return -1; } @@ -29,7 +29,7 @@ impl PalSignal for Sys { let _ = syscall::close(fd); - if count < 0 { + if count == !0 { return -1; } @@ -65,7 +65,7 @@ impl PalSignal for Sys { }; let fd = e(syscall::open(path, syscall::O_RDWR | syscall::O_CLOEXEC)); - if fd < 0 { + if fd == !0 { return -1; } @@ -73,7 +73,7 @@ impl PalSignal for Sys { let mut count = e(syscall::read(fd, &mut spec)); - if count >= 0 { + if count != !0 { unsafe { if ! old.is_null() { (*old).it_interval.tv_sec = spec.it_interval.tv_sec; @@ -93,7 +93,7 @@ impl PalSignal for Sys { let _ = syscall::close(fd); - if count < 0 { + if count == !0 { return -1; }