-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
differences in struct ifaddrs
#682
Comments
Platforms like Solaris and some BSD platforms aren't verified automatically today, so feel free to change the definition on those paltforms! |
Can Travis test BSD/Solaris? |
Only with QEMU currently, they don't offer native hosts running BSD/Solaris |
I have a buildbot that I use to test nix and mio-aio on freebsd. What does it take to verify libc? I have plenty of cpu cycles to spare. |
Oh note that we've already got QEMU emulation of FreeBSD, is that sufficient for libc? |
Yeah, QEMU is probably good enough for libc, as long as its fast enough. |
Actually, things aren't as bad as @mwanner thinks. The man pages make it look like the BSDs have an extra Here are links to the structure definitions, as opposed to man pages A maintainer should retitle the issue to "missing field for struct ifaddrs on NetBSD" |
Registering an interest regarding this for Android. I've noticed that this seems to be absent from the linux path? Specifically the following in seem to be missing from To further complicate things, if this repo is to be believed, it seems that the Android NDK might not support |
The NetBSD situation with ifa_addrflags is complicated. The still-supported NetBSD 7.x release series does not have the ifa_addrflags field, while the NetBSD 8.x release series and -current do. I've not looked closely as to what this particular difference means for compatibility of binaries. The lack of OS-level ABI/API breaking-change handling in the libc crate leaves a lot to be desired… |
It seems that a lot of work has happened here already. What exactly remains to be done here? |
I agree, |
This adds support for visionOS and `target_env = "newlib"` (embedded) platforms by always providing an implementation, such that only one of these `cfg` lists have to be maintained. A little bit of context on why these names are not just unified in `libc` can be found in rust-lang/libc#682.
Currently, there are two variants of
struct ifaddrs
in libc: one matching Linux with anifa_ifu
field and an OS X variant with onlyifa_dstaddr
. However, some other BSD derivates defineifa_broadaddr
as well, which isn't currently covered (and I guess the fields would be misaligned on systems havingifa_broadaddr
as a separate field in the struct).Googling for
getifaddr
man pages, I found these different definitions:Variant 1: union:
http://man7.org/linux/man-pages/man3/getifaddrs.3.html (Linux)
https://docs.oracle.com/cd/E26502_01/html/E29035/getifaddrs-3socket.html (Solaris 11)
Variant 2: only
ifa_dstaddr
, noifa_broadaddr
(or possibly a macro onifa_dstaddr
):https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/getifaddrs.3.html (OS X)
Variant 3: separate fields
ifa_dstraddr
andifa_broadaddr
:http://netbsd.gw.com/cgi-bin/man-cgi?getifaddrs+3+NetBSD-current (NetBSD)
https://www.freebsd.org/cgi/man.cgi?getifaddrs (FreeBSD)
https://man.openbsd.org/getifaddrs.3 (OpenBSD)
Based on these findings, I suppose
struct ifaddr
insrc/unix/bsd/mod.rs
would have to move down to the variant-specific fiels underapple
,freebsdlike
andnetbsdlike
to adjust for this difference. And the Solaris variant should probably simply be changed to useifa_ifu
. Any other platform that needs to be supported and checked?The text was updated successfully, but these errors were encountered: