-
Notifications
You must be signed in to change notification settings - Fork 130
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
update recv to use correct values on FreeBSD #343
Conversation
Can you either change only the parts that are affected, like |
Updated my commit to be more "surgical." Thanks for the suggestions. |
0a84f22
to
8535ae0
Compare
src/platform/unix/mod.rs
Outdated
#[cfg(target_os = "freebsd")] | ||
let result = libc::poll( | ||
fd.as_mut_ptr(), | ||
fd.len() as libc::c_uint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to use as _
and avoid any platform-specific code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed up.
Use correct value for POLLRDHUP and make fd.len cast more portable. Signed-off-by: 180watt <180watt@duck.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have missed a critical |
It's rather unfortunate that Rust's libc doesn't know that FreeBSD has POLLRDHUP, but in the mean time we can add the value ourselves. We also need to use a uint for
nfds_t
. It seems that illumos also has POLLRDHUP, so this implementation could work there too. (Testing welcome.) I'm a novice when it comes to Rust, so any suggestions to this patch is very welcomed.P.S. I failed to mention this, but in its current state (pre-patch), ipc-channel fails to build on FreeBSD