Ignore SIGSYS on BSD by default

This commit is contained in:
Justine Tunney 2022-11-03 09:32:12 -07:00
parent 179e048bba
commit 37d40e087f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
7 changed files with 48 additions and 16 deletions

View file

@ -21,6 +21,7 @@
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
#include "libc/calls/struct/sigset.h"
#include "libc/calls/syscall_support-sysv.internal.h"
#include "libc/calls/ucontext.h"
#include "libc/dce.h"
#include "libc/errno.h"
@ -204,3 +205,9 @@ TEST(sigaction, autoZombieSlayer) {
// clean up
ASSERT_SYS(0, 0, sigaction(SIGCHLD, &sa, 0));
}
TEST(sigaction, enosys_returnsErrnoRatherThanSigsysByDefault) {
if (IsTiny()) return; // systemfive.S disables the fix w/ tiny
if (IsOpenbsd()) return; // TODO: Why does OpenBSD raise SIGABRT?
ASSERT_SYS(ENOSYS, -1, sys_bogus());
}