-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
os/signal: No access to the siginfo_t struct #9764
Comments
We'd need to figure out a nice, portable API to do this. |
https://man7.org/linux/man-pages/man2/sigaction.2.html is the referenced Structure. |
The stress here is on portable. The man page you cite is Linux-specific. |
Rather than needing a super portable way to do this, could we simply add access to it through /x/sys/unix because of its specificity? It's really dragging down a project of mine to not have access to this struct in any way. |
We still need a nice, portable API. I don't see how using x/sys/unix helps. I don't have any ideas for an API. |
Please correct me if I'm mistaken, but it seems the SignalfdSigInfo struct is equivalent to siginfo_t - only missing a few fields, including |
I agree what we don't need a portable API for the exact definition of What we need is a portable API for how to access that system-specific information. |
SignalfdSiginfo is not an equivalent of siginfo_t and isn't supposed to be, that's my bad. |
I think solution here could be similar. I think This could be done with additional interface:
And some implementations of the |
Unfortunately I don't see how that suggestion would work given our existing choices. We've already promised that on Unix systems, the implementation of the |
Hm, If this is not possible, then maybe |
I don't see any ambiguity in the docs for |
So what about |
I have no particular objection to |
In the 90'ies we had this joke:
Please fix this and don't make me repeat 30 years old jokes with references to the present times. |
Maybe this could be implemented on Linux using signalfd. It seems semantic-wise very similar to how Go maps signals to channels so it might be easier to implement. |
The siginfo_t struct that is delivered with signals contains various useful information about the signal. In some cases, this information is necessary to implement the kernel API of various features. For example, fcntl(F_SETLEASE) requires that your process receive a SIGIO when the lock is broken, and the si_fd field in the siginfo_t struct tells you what filehandle the kernel is notifying your process about.
Please provide an interface that will allow Go code to access the information in the siginfo_t struct.
The text was updated successfully, but these errors were encountered: