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

Support SIGRTMIN+n signals. #1292

Merged
merged 10 commits into from
Jan 28, 2025
Merged

Support SIGRTMIN+n signals. #1292

merged 10 commits into from
Jan 28, 2025

Conversation

sunfishcode
Copy link
Member

Change Signal from an enum to a struct wrapper around an i32 so that it can accomodate values it doesn't know about statically, and add APIs for constructing and working with SIGRTMIN+n signal values.

This requires making Signal::from_raw depend on a new "use-libc-sigrt" feature, as it depends on being able to call into libc. This also adds Signal::from_raw_unchecked which does not call into libc and is unsafe.

Fixes #1249.

Change `Signal` from an `enum` to a `struct` wrapper around an `i32`
so that it can accomodate values it doesn't know about statically,
and add APIs for constructing and working with `SIGRTMIN+n` signal
values.

This requires making `Signal::from_raw` depend on a new "use-libc-sigrt"
feature, as it depends on being able to call into libc. This also adds
`Signal::from_raw_unchecked` which does not call into libc and is
unsafe.

Fixes #1249.
@sunfishcode sunfishcode marked this pull request as ready for review January 27, 2025 18:07
@sunfishcode sunfishcode added the semver bump Issues that will require a semver-incompatible fix label Jan 27, 2025
@joshtriplett
Copy link
Member

This looks great, thank you.

@sunfishcode sunfishcode merged commit fc2a014 into main Jan 28, 2025
43 of 45 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/sigrt branch January 28, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver bump Issues that will require a semver-incompatible fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signal should support arbitrary signals
2 participants