-
Notifications
You must be signed in to change notification settings - Fork 665
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
sigaction struct on OS X #49
Comments
@vbuslov there is no way to define unions in Rust, in case of data with the same size (like pointer to a function) workaround is to use |
I have the same problem and was thinking of using one or two enums to encapsulate the differences between |
Great! Looking forward to it. |
#241 would solve the second part of the question. The first would be solved by using libc's raw structs instead of our own. See https://github.com/rust-lang-nursery/libc/blob/master/src/unix/bsd/apple/mod.rs . |
Filed #264 to track the first part. I'll start on the signal module which should let us close this. |
8f1d193 fixes the first part, which should resolve this issue. |
I've been looking on signal-handling code in nix-rust to implement signal support in mio and it seems that sigaction struct definition for OS X is a bit off.
Relevant definition from 10.10:
struct definition from nix:
So it seems that nix defines sigaction according to private kernel-user boundary OS X struct instead of public struct which actually used as param type to sigaction function.
Also I need the sa_sigaction(instead of sa_handler which is currently used in nix struct) handler to obtain siginfo_t structure and I'm struggling to define c-union in Rust. Any suggestions?
The text was updated successfully, but these errors were encountered: