From 9999bb6068225d636741ce8828a78002f6524969 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Mon, 31 Mar 2025 11:41:07 +0200 Subject: [PATCH] Add ThisGroup selector for kill. --- redox-rt/src/protocol.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/redox-rt/src/protocol.rs b/redox-rt/src/protocol.rs index be41985586..25b9323bd8 100644 --- a/redox-rt/src/protocol.rs +++ b/redox-rt/src/protocol.rs @@ -96,6 +96,7 @@ pub fn wcoredump(status: usize) -> bool { } #[derive(Clone, Copy, Debug)] pub enum ProcKillTarget { + ThisGroup, SingleProc(usize), ProcGroup(usize), All, @@ -103,6 +104,7 @@ pub enum ProcKillTarget { impl ProcKillTarget { pub fn raw(self) -> usize { match self { + Self::ThisGroup => 0, Self::SingleProc(p) => p, Self::ProcGroup(g) => usize::wrapping_neg(g), Self::All => usize::wrapping_neg(1), @@ -110,7 +112,9 @@ impl ProcKillTarget { } pub fn from_raw(raw: usize) -> Self { let raw = raw as isize; - if raw == -1 { + if raw == 0 { + Self::ThisGroup + } else if raw == -1 { Self::All } else if raw < 0 { Self::ProcGroup(raw as usize)