From c52c4fec53d07c747f1cf1b8c05ede36f34de303 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Wed, 16 Apr 2025 11:58:21 +0200 Subject: [PATCH] Move most sig numbers to redox_rt. --- src/flag.rs | 27 --------------------------- src/sigabi.rs | 4 +++- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/flag.rs b/src/flag.rs index 7b172c0c94..fe69a5c056 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -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; diff --git a/src/sigabi.rs b/src/sigabi.rs index 218dc27aee..292eb9ab26 100644 --- a/src/sigabi.rs +++ b/src/sigabi.rs @@ -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)