feat: add process termination codes and SYS_ABORT; whole-process abort() from any thread in libc and montauk-rt

This commit is contained in:
daniel committed 2026-10-14 07:32:15 +02:00
1 parent f8b8f9610f
commit 278b208258
15 files changed
+126 -37

No files matched your search

+1 -1
View File
@@ -1885,7 +1885,7 @@ namespace Sched {
continue;
}
primary.exitCode = 256 + 9; /* killed (SIGKILL) */
primary.exitCode = TerminatedKilled;
primary.killPending = true;
if (primary.state == ProcessState::Blocked) {
primary.state = ProcessState::Ready;
+3 -2
View File
@@ -6,6 +6,7 @@
#pragma once
#include <cstdint>
#include <Common/TerminationCodes.hpp>
#include <atomic>
#include <Api/Syscall.hpp>
@@ -303,9 +304,9 @@ namespace Sched {
// Kill a process by PID. If the process is running on another CPU,
// sets a kill-pending flag checked on the next timer tick. exitCode is
// what a waiter sees (256+sig; SIGKILL by default).
// what a waiter sees (a TerminationCodes value).
// Returns 0 on success, -1 on failure.
int KillProcess(int pid, int exitCode = 256 + 9);
int KillProcess(int pid, int exitCode = TerminatedKilled);
// Start a new process session for the caller, or terminate every process
// belonging to a session. KillSession returns the number of live members