-
Notifications
You must be signed in to change notification settings - Fork 1.1k
The libc::sigaction
struct doesn't contain any way to access the underlying sa_handler
field.
#3111
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
Comments
What platforms is this missing on? From a quick breeze, all of our (too many) A PR is welcome here as needed. |
I've not done an exhaustive check, but I have run into it in x86-64.
Edit: to be clear, the problem isn't that |
Would you happen to know which platforms require the struct to have |
@highjeans Both fields are required in all Unix-like systems per POSIX spec. The spec just allows systems to place the fields in overlapping memory if it so chooses (and turns out, everyone does exactly that in practice). Specifically, Here's a line-by-line of all supported platforms with a
@tgross35 From a quick search, here's the platforms
Conversely, here's the platforms
Hopefully, this can help you figure out what needs what. |
Per https://pubs.opengroup.org/onlinepubs/007904875/functions/sigaction.html and https://man7.org/linux/man-pages/man2/sigaction.2.html, there's an
sa_handler
field for thesigaction
struct. On Linux with some architectures, it may be aliased tosa_sigaction
, but it's always there.This is required in order to know what the previous signal handler was, and more importantly, whether it was previously ignored (
.sa_handler == SIG_IGN
) or set to the default disposition (.sa_handler == SIG_DFL
).Also, this allows omitting the
SA_SIGINFO
property ofsa_flags
, offering a simpler API for most common cases as it's just one (commonly-ignored) argument, not three.The text was updated successfully, but these errors were encountered: