if we compare wasi-libc/libc-top-half/musl/arch/wasm32/bits/signal.h with wasi/api.h, we see wasi-libc defines SIGSTKFLT as signal 16, but this signal does not exist in the WASI spec at all. this causes all remaining signals to be off-by-one.
for example, the first few around the desync:
| signal |
wasi-libc |
wasi API |
| SIGPIPE |
13 |
13 |
| SIGALRM |
14 |
14 |
| SIGTERM |
15 |
15 |
| SIGSTKFLT |
16 |
- |
| SIGCHLD |
17 |
16 |
| SIGCONT |
18 |
17 |
| SIGSTOP |
19 |
18 |
this makes working with signals kind of a pita as we have to maintain 2 tables and their mappings between them. from a simplicity pov, wasi-libc should just use the same set of signals & signal numbers as wasi api and call it a day.
if we compare
wasi-libc/libc-top-half/musl/arch/wasm32/bits/signal.hwithwasi/api.h, we see wasi-libc definesSIGSTKFLTas signal 16, but this signal does not exist in the WASI spec at all. this causes all remaining signals to be off-by-one.for example, the first few around the desync:
this makes working with signals kind of a pita as we have to maintain 2 tables and their mappings between them. from a simplicity pov, wasi-libc should just use the same set of signals & signal numbers as wasi api and call it a day.