-
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
linux: add missing SOL_* constants #228
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Looks like CI says some constants aren't defined? Perhaps a missing header to include? |
Yes, working on fixing up the tests. Bionic/kernel define several that aren't defined for musl/glibc. I think it is reasonable to define them all for Linux platforms, so I'll push an amended commit once I think I have things in place. |
Ok, thanks! Feel free to ping the PR once tests are passing and I will r+ |
6fc5783
to
f679d3d
Compare
SOL_SOCKET appears to be the only constant that is not the same across architectures and it was already present in libc. The constants provided match bionic and the Linux kernel but are a supseret of those provided by musl and glibc. They are just constants, so it should be fine (and avoids upstream from having to define/maintain them). Signed-off-by: Paul Osborne <osbpau@gmail.com>
f679d3d
to
3a01937
Compare
Ok @alexcrichton, should be ready for review. Appveyor is a bit backed up, but things are passing on travis. |
"SOL_LLC" | | ||
"SOL_DCCP" | | ||
"SOL_NETLINK" | | ||
"SOL_TIPC" if linux => true, |
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.
Hm I'm a little wary of including constants that aren't in glibc or musl yet. Perhaps these could be android-only for now? Or should we update glibc to start verifying them?
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.
Working with glibc to verify these seems like it might be a reasonable approach although they probably move forward at a snails pace for fear of breaking existing code that has already defined constants missing from its headers (I found several major projects defining SOL_NETLINK
themselves, some without an #ifndef
check). That is, I think the lack of definition of these constants might have less to do with stability and more to do with the inability to have nice things when working in C.
Another angle would be to verify some definitions against the kernel headers. I don't see a good way of mixing glibc headers and kernel headers together, but having a separate set of tests which verify against kernel sources might have some legs.
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.
Hm ok, I'm largely just wary to include such a large set of constants in the ignore list. This'd mean that they're never validated, and I don't necessarily trust architectures like MIPS to have all the same values for all the constants. It's ok if they're not tested on MUSL, but they should be tested somewhere.
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.
Understood. I'll see what I can come up with. I would be fine with dropping all of these as well except SOL_NETLINK
if it comes to that. They are tested in Android, so there is some validation going on (but we do not validate Android on non-ARM).
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.
Ok, sounds good to me!
Closing due to inactivity, but feel free to resubmit with comments addressed! |
* sse2: _mm_stream_si128,si32,pd,si64 * sse2: _mm_stream_* tests * Disable assert_instr for _mm_stream_si64
SOL_SOCKET appears to be the only constant that is not the
same across architectures and it was already present in libc.
Signed-off-by: Paul Osborne osbpau@gmail.com