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

Add SEEK_DATA/SEEK_HOLE constants #319

Merged
merged 1 commit into from
Jun 21, 2016

Conversation

posborne
Copy link
Contributor

Relates to nix-rust/nix#377. These constants
are only available in systems running the Linux kernel.

@rust-highfive
Copy link

r? @alexcrichton

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

@alexcrichton
Copy link
Member

Thanks! Looks like these constants may not exist yet on musl though?

@posborne
Copy link
Contributor Author

Thanks! Looks like these constants may not exist yet on musl though?

Yes, that would appear to be the case. Wasn't sure, so I figured I would let CI let me know. I'll add an ignore in the tests for that constant for musl (I believe that is the best way to handle).

@alexcrichton
Copy link
Member

Ah the preferred method is actually to duplicate these constants down to the level where they're defined (e.g. android + non-musl linux) rather than #[cfg(not(..))] but other than that sounds good to me.

@posborne
Copy link
Contributor Author

Ah the preferred method is actually to duplicate these constants down to the level where they're defined (e.g. android + non-musl linux) rather than #[cfg(not(..))] but other than that sounds good to me.

I can do this, although it doesn't seem strictly necessary (or beneficial) and makes usage of the constants in downstream crates more complicated as instead of worrying about the OS we need to be concerned with the libc implementation (which is fine in some cases, but unnecessary here). These constants are defined by the kernel and musl lets the kernel accept/reject the values for calls where they are used (e.g. lseek).

@alexcrichton
Copy link
Member

Ah yeah we just typically try to stick to the musl headers, regardless of whether they just forward it to the kernel or not

@posborne
Copy link
Contributor Author

Sure, I'll take a look at fixing musl as well then.

Relates to nix-rust/nix#377.  These constants
are only available in systems running the Linux kernel and are not
defined in musl libc (yet).

Signed-off-by: Paul Osborne <[email protected]>
@posborne posborne force-pushed the additional-seek-constants branch from 30befca to 45448fb Compare June 21, 2016 05:56
@posborne
Copy link
Contributor Author

posborne commented Jun 21, 2016

Ok, Travis is happy after amending the commit to have the constants live under unix/notbsd/linux/other

@alexcrichton
Copy link
Member

@bors: r+ 45448fb

@bors
Copy link
Contributor

bors commented Jun 21, 2016

⌛ Testing commit 45448fb with merge 1e2d77a...

bors added a commit that referenced this pull request Jun 21, 2016
Add SEEK_DATA/SEEK_HOLE constants

Relates to nix-rust/nix#377.  These constants
are only available in systems running the Linux kernel.
@bors
Copy link
Contributor

bors commented Jun 21, 2016

☀️ Test successful - status-appveyor, travis

@bors bors merged commit 45448fb into rust-lang:master Jun 21, 2016
danielverkamp pushed a commit to danielverkamp/libc that referenced this pull request Apr 28, 2020
Support isn't quite in nightly to make this work yet, but using a local build
this gets everything passing again! This also implements native verification
that we have the attribute in the right place
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.

4 participants