Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/syscall/syscall_libc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ const (

type Signal int

// Source: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/signal.h
const (
SIGCHLD Signal = 0x14
SIGINT Signal = 0x2
SIGKILL Signal = 0x9
SIGTRAP Signal = 0x5
SIGQUIT Signal = 0x3
SIGTERM Signal = 0xf
SIGINT Signal = 2 /* interrupt */
SIGQUIT Signal = 3 /* quit */
SIGILL Signal = 4 /* illegal instruction (not reset when caught) */
SIGTRAP Signal = 5 /* trace trap (not reset when caught) */
SIGABRT Signal = 6 /* abort() */
SIGFPE Signal = 8 /* floating point exception */
SIGKILL Signal = 9 /* kill (cannot be caught or ignored) */
SIGBUS Signal = 10 /* bus error */
SIGSEGV Signal = 11 /* segmentation violation */
SIGPIPE Signal = 13 /* write on a pipe with no one to read it */
SIGTERM Signal = 15 /* software termination signal from kill */
SIGCHLD Signal = 20 /* to parent on child stop or exit */
)

func (s Signal) Signal() {}
Expand Down
14 changes: 11 additions & 3 deletions src/syscall/syscall_libc_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ import (
)

// https://github.com/WebAssembly/wasi-libc/blob/main/expected/wasm32-wasi/predefined-macros.txt
// disagrees with ../../lib/wasi-libc/libc-top-half/musl/arch/wasm32/bits/signal.h for SIGCHLD?
// https://github.com/WebAssembly/wasi-libc/issues/271

type Signal int

const (
SIGCHLD Signal = 16
SIGINT Signal = 2
SIGKILL Signal = 9
SIGTRAP Signal = 5
SIGQUIT Signal = 3
SIGILL Signal = 4
SIGTRAP Signal = 5
SIGABRT Signal = 6
SIGBUS Signal = 7
SIGFPE Signal = 8
SIGKILL Signal = 9
SIGSEGV Signal = 11
SIGPIPE Signal = 13
SIGTERM Signal = 15
SIGCHLD Signal = 17
)

func (s Signal) Signal() {}
Expand Down