Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion around SIGCHLD value? #271

Closed
dkegel-fastly opened this issue Mar 19, 2022 · 2 comments · Fixed by #278
Closed

Confusion around SIGCHLD value? #271

dkegel-fastly opened this issue Mar 19, 2022 · 2 comments · Fixed by #278

Comments

@dkegel-fastly
Copy link

What's the right value to use for SIGCHLD in a wasi app... 16 or 17?

$ find . -type f -print0 | xargs -0 grep CHLD | egrep 'wasm|wasi'
./libc-top-half/musl/arch/wasm32/bits/signal.h:#define SIGCHLD   17
./expected/wasm32-wasi/predefined-macros.txt:#define __WASI_SIGNAL_CHLD (UINT8_C(16))
./libc-bottom-half/headers/public/wasi/api.h:#define __WASI_SIGNAL_CHLD (UINT8_C(16))
@dkegel-fastly
Copy link
Author

I mean, it's kind of moot since wasi doesn't really have signals, but still...

@sunfishcode
Copy link
Member

I think the answer is 17. WebAssembly as a platform doesn't support signals, and isn't likely going to for the foreseeable future, so these constants will be defined by wasi-libc, which uses them for some amount of emulation, and not by the WASI spec itself.

sunfishcode added a commit that referenced this issue Mar 23, 2022
The WASI signal constants and proc_raise function were removed in the
latest [ephemeral], which had been scheduled to be in the next snapshot,
however WASI itself is now transitioning away from the snapshot system.

WASI libc will also be transitioning to updated wit specs once they're
ready, however until that time, we can make the simple change of
removing these signal constants to avoid confusion.

Fixes #271.
Fixes #272.

[ephemeral]: https://github.com/WebAssembly/WASI/tree/main/phases/ephemeral/witx
sunfishcode added a commit that referenced this issue Mar 28, 2022
The WASI signal constants and proc_raise function were removed in the
latest [ephemeral], which had been scheduled to be in the next snapshot,
however WASI itself is now transitioning away from the snapshot system.

WASI libc will also be transitioning to updated wit specs once they're
ready, however until that time, we can make the simple change of
removing these signal constants to avoid confusion.

Fixes #271.
Fixes #272.

[ephemeral]: https://github.com/WebAssembly/WASI/tree/main/phases/ephemeral/witx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants