mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 02:08:30 +00:00
Ignore SIGSYS on BSD by default
This commit is contained in:
parent
179e048bba
commit
37d40e087f
7 changed files with 48 additions and 16 deletions
|
@ -20,8 +20,11 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nexgen32e/macros.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
|
||||
#define SIG_IGN 1
|
||||
|
||||
/* ▄▄▄
|
||||
▄▄▄ ▀▓▓▒▄
|
||||
▄▓▒▒░ ▀▓▒▒▒▄
|
||||
|
@ -363,6 +366,31 @@ _init_systemfive_pid:
|
|||
1: stosq
|
||||
.endfn _init_systemfive_pid
|
||||
#endif
|
||||
#if SupportsBsd() && !defined(TINY)
|
||||
_init_systemfive_sigsys:
|
||||
testb IsBsd() # BSDs will trap SIGSYS!
|
||||
jz 1f # We want ENOSYS instead
|
||||
push %rdi # XNU removed some calls
|
||||
push %rsi # in past, so this makes
|
||||
xor %eax,%eax # troubleshooting easier
|
||||
push %rax # but it's non-essential
|
||||
push %rax
|
||||
push %rax
|
||||
push %rax
|
||||
push %rax
|
||||
push $SIG_IGN # sigaction_meta size 48
|
||||
mov __NR_sigaction,%eax # mag
|
||||
mov SIGSYS,%edi # sig
|
||||
mov %rsp,%rsi # new
|
||||
xor %edx,%edx # old
|
||||
mov $8,%r10d # for linux
|
||||
xor %r8d,%r8d # for netbsd
|
||||
syscall
|
||||
add $6*8,%rsp
|
||||
pop %rsi
|
||||
pop %rdi
|
||||
1: .endfn _init_systemfive_sigsys
|
||||
#endif
|
||||
#if SupportsSystemv() && !defined(TINY)
|
||||
_init_systemfive_syscall:
|
||||
mov __NR_msyscall,%eax # syscall origin protect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue