Grab The Current PID To Abort On

Setting the pid to 0 will send the SIGABRT signal to "every process in the process group of the calling process". This means that darlingserver will also get killed as a result (which we don't want to happen).
This commit is contained in:
Thomas A. 2024-01-21 11:53:20 -08:00
parent 60dc3751f3
commit 780bd91d1c

View File

@ -5,6 +5,7 @@
#include <linux-syscalls/linux.h>
#include "mach/lkm.h"
#include "signal/kill.h"
#include "unistd/getpid.h"
#include <sys/signal.h>
#include <darlingserver/rpc.h>
@ -574,6 +575,6 @@ have_nl:
__attribute__ ((visibility ("default")))
void __simple_abort(void) {
sys_kill(0, SIGABRT, 1);
sys_kill(sys_getpid(), SIGABRT, 1);
__builtin_unreachable();
};