-
Notifications
You must be signed in to change notification settings - Fork 1.1k
linux: Add missing Linux-specific fcntls #233
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
36bf17e
to
104563f
Compare
linux: Add missing Linux-specific fcntls Also move F_DUPFD_CLOEXEC up a level as it is available on Android.
104563f
to
79e628c
Compare
Failures are all lack of Reading that, I realize I should have also added the @alexcrichton should I keep these constants in and modify the test code to ignore them? |
79e628c
to
0118fe4
Compare
Well, I modified test code to ignore them in the meantime in case you choose to r+ it. At least then tests should be passing when @bors gets to it. :-) |
Related to #228, I'm seeing if I can come up with a decent solution for verifying some constants against the kernel headers themselves. There are few challenges there:
I haven't done much in the way of implementation towards this goal as of yet, but my gut tells me that some modifications to ctest will be in order to only include (rather than exclude as is the case presently) certain symbols/patterns in what is tested. Even if some of these things end up being definitions we want to include in dowstream crates, the ability to verify that constants and other items match the operating systems C definitions should be very useful. |
Thanks for opening #234. I would be in favor of an approach using generation -- might be worth studying what is done in bionic. |
I'd like to avoid adding constants to libc that are entirely untested in swaths like this, ignore a constant is basically a "massive hammer" to a solution. If these aren't present in header files, how does C access these constants? That is, if we can't verify them, how can anyone use them? |
@alexcrichton The unfortunate answer for most C code is that you end up copying the header out of the kernel and into your application -- I have had to do this many times and it always bothered me. If you are lucky, there is a library (for example, Starting with kernel 3.7, there has been a push to separate the headers that are suitable for inclusion from userspace (or at least from libc) into the The idea has been around for awhile, but it recently got a bigger push. Pinging @mkerrisk to see if he has any advice in this regard for libc authors (in this case, in a non-C based language). |
Interesting, thanks for the info @posborne! If those headers are explicitly intended to be included by userspace, perhaps this PR could start including that? Or does the travis builder not have those headers yet? |
I didn't know too much about this, thanks for the links @posborne. From reading a bit more, it appears that these uapi headers end up being installed under For the sake of this change, and the constants I actually want right now, I've deferred the file sealing fcntls and associated bitflag constants. I opened #235 for the greater change to verifying against other headers. |
Also move F_DUPFD_CLOEXEC up a level as it is available on Android. This commit leaves file sealing related fcntls and bitflag constants out, as they are defined in `linux/fcntl.h` rather than `fcntl.h`. They can be included once an approach for verification has been figured out. See rust-lang#235 for more detail.
b43118c
to
5c55ce0
Compare
Testing including them in Android and musl. musl should definitely have them; not 100% sure of Android. |
5c55ce0
to
b43118c
Compare
Androind and musl failed; reverted to omitting them. |
linux: Add missing Linux-specific fcntls Also move F_DUPFD_CLOEXEC up a level as it is available on Android.
☀️ Test successful - status-appveyor, travis |
Also move F_DUPFD_CLOEXEC up a level as it is available on Android.