-
Notifications
You must be signed in to change notification settings - Fork 654
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
Rely on libc for more socket constants #636
Conversation
src/sys/socket/consts.rs
Outdated
pub const TCP_KEEPALIVE: c_int = libc::TCP_KEEPALIVE; | ||
#[cfg(target_os = "freebsd")] | ||
#[cfg(target_os = "freebsd", target_os = "netbsd")] |
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.
Missing an any(
expression in your #[cfg
. Also, libc has not defined TCP_KEEPIDLE
for NetBSD. Only for FreeBSD, Dragonfly, Linux, Android, and Solaris.
src/sys/socket/consts.rs
Outdated
pub const IPPROTO_IPV6: c_int = 41; | ||
pub const IPPROTO_TCP: c_int = 6; | ||
pub const IPPROTO_UDP: c_int = 17; | ||
pub const SOL_SOCKET: c_int = libc::SOCK_SOCKET; |
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.
should this be libc::SOL_SOCKET`?
2fa4eea
to
b2a0b40
Compare
I still can't find the |
93091ff
to
24e7f6f
Compare
@asomers Good catch on both of those, they've since been fixed. Now we just need our CI to work again! |
Everything looks good to me. Too bad we can't tell bors yet. |
bors r+ |
Build failed |
Looks like the build failed due to undefined symbols in Linux for arm, i686, powerpc, musl, and netbsd. Also, the x86_64-unknown-linux test with Rust=beta failed due to PR #642 |
Yes, this is blocking on upstream (rust-lang/libc#639). |
Add socket constants for more platforms Missing a few constants across all nix-supported platforms (see nix-rust/nix#636) so this adds them. This is still a work in progress as I wanted to make sure I didn't break anything doing most of the fixes. I'll come back and finish this up later.
bors r+ |
Build succeeded |
Not all values are upstreamed, but this covers the vast majority of them.