From 8a76db3ab7da246c9808769a49d24cfd61b4bbfb Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Wed, 7 May 2025 19:31:58 +0200 Subject: [PATCH] libmain: tell kj to use SIGUSR2 fixes #679 Change-Id: Ib7c8afd0192c7329ab3ca90925b1b756b6918c7a --- lix/libmain/shared.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lix/libmain/shared.cc b/lix/libmain/shared.cc index 04cf476f7..1dd3b93d4 100644 --- a/lix/libmain/shared.cc +++ b/lix/libmain/shared.cc @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #include #endif +#include #include @@ -128,6 +130,12 @@ static void sigHandler(int signo) { } void initNix() { + // kj needs a signal for internal use. no system lix habitually runs on causes + // kj to actually *use* this signal, but better safe than sorry—and since some + // OSes (*cough* macos) don't support realtime signals we must use SIGUSR2 for + // this, thus "consuming" both USR signals. at some point we will change this. + kj::UnixEventPort::setReservedSignal(SIGUSR2); + registerCrashHandler(); /* Turn on buffering for cerr. */