Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

posborne
Copy link
Contributor

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

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Looks like CI says some constants aren't defined? Perhaps a missing header to include?

@posborne
Copy link
Contributor Author

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.

@alexcrichton
Copy link
Member

Ok, thanks! Feel free to ping the PR once tests are passing and I will r+

@posborne posborne force-pushed the socket-constants-sol branch 2 times, most recently from 6fc5783 to f679d3d Compare March 14, 2016 20:59
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>
@posborne posborne force-pushed the socket-constants-sol branch from f679d3d to 3a01937 Compare March 14, 2016 21:48
@posborne
Copy link
Contributor Author

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,
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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).

Copy link
Member

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!

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with comments addressed!

danielverkamp pushed a commit to danielverkamp/libc that referenced this pull request Apr 28, 2020
* sse2: _mm_stream_si128,si32,pd,si64

* sse2: _mm_stream_* tests

* Disable assert_instr for _mm_stream_si64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants