Move most sig numbers to redox_rt.
This commit is contained in:
-27
@@ -272,37 +272,10 @@ pub const SEEK_SET: usize = 0;
|
||||
pub const SEEK_CUR: usize = 1;
|
||||
pub const SEEK_END: usize = 2;
|
||||
|
||||
pub const SIGHUP: usize = 1;
|
||||
pub const SIGINT: usize = 2;
|
||||
pub const SIGQUIT: usize = 3;
|
||||
pub const SIGILL: usize = 4;
|
||||
pub const SIGTRAP: usize = 5;
|
||||
pub const SIGABRT: usize = 6;
|
||||
pub const SIGBUS: usize = 7;
|
||||
pub const SIGFPE: usize = 8;
|
||||
pub const SIGKILL: usize = 9;
|
||||
pub const SIGUSR1: usize = 10;
|
||||
pub const SIGSEGV: usize = 11;
|
||||
pub const SIGUSR2: usize = 12;
|
||||
pub const SIGPIPE: usize = 13;
|
||||
pub const SIGALRM: usize = 14;
|
||||
pub const SIGTERM: usize = 15;
|
||||
pub const SIGSTKFLT: usize = 16;
|
||||
pub const SIGCHLD: usize = 17;
|
||||
pub const SIGCONT: usize = 18;
|
||||
pub const SIGSTOP: usize = 19;
|
||||
pub const SIGTSTP: usize = 20;
|
||||
pub const SIGTTIN: usize = 21;
|
||||
pub const SIGTTOU: usize = 22;
|
||||
pub const SIGURG: usize = 23;
|
||||
pub const SIGXCPU: usize = 24;
|
||||
pub const SIGXFSZ: usize = 25;
|
||||
pub const SIGVTALRM: usize = 26;
|
||||
pub const SIGPROF: usize = 27;
|
||||
pub const SIGWINCH: usize = 28;
|
||||
pub const SIGIO: usize = 29;
|
||||
pub const SIGPWR: usize = 30;
|
||||
pub const SIGSYS: usize = 31;
|
||||
|
||||
pub const ADDRSPACE_OP_MMAP: usize = 0;
|
||||
pub const ADDRSPACE_OP_MUNMAP: usize = 1;
|
||||
|
||||
+3
-1
@@ -20,7 +20,7 @@ pub struct RealtimeSig {
|
||||
pub struct RawAction {
|
||||
/// Only two MSBs are interesting for the kernel. If bit 63 is set, signal is ignored. If bit
|
||||
/// 62 is set and the signal is SIGTSTP/SIGTTIN/SIGTTOU, it's equivalent to the action of
|
||||
/// SIGSTOP.
|
||||
/// Stop.
|
||||
pub first: AtomicU64,
|
||||
/// Completely ignored by the kernel, but exists so userspace can (when 16-byte atomics exist)
|
||||
/// atomically set both the handler, sigaction flags, and sigaction mask.
|
||||
@@ -134,6 +134,7 @@ pub fn sig_bit(sig: usize) -> u64 {
|
||||
1 << (sig - 1)
|
||||
}
|
||||
impl SigProcControl {
|
||||
// TODO: Move to redox_rt?
|
||||
pub fn signal_will_ign(&self, sig: usize, is_parent_sigchld: bool) -> bool {
|
||||
let flags = self.actions[sig - 1].first.load(Ordering::Relaxed);
|
||||
let will_ign = flags & (1 << 63) != 0;
|
||||
@@ -141,6 +142,7 @@ impl SigProcControl {
|
||||
|
||||
will_ign || (sig == SIGCHLD && is_parent_sigchld && sig_specific)
|
||||
}
|
||||
// TODO: Move to redox_rt?
|
||||
pub fn signal_will_stop(&self, sig: usize) -> bool {
|
||||
use crate::flag::*;
|
||||
matches!(sig, SIGTSTP | SIGTTIN | SIGTTOU)
|
||||
|
||||
Reference in New Issue
Block a user