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. */