-
Notifications
You must be signed in to change notification settings - Fork 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
Make statx available for all Linux targets #2713
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
Oh, is there no musl/uClibc CI? |
We do have it but it is only run by bors, not the normal CI for PRs. @bors r+ |
📌 Commit d37715d has been approved by |
Make statx available for all Linux targets I _think_ all this should be available on all Linux targets now, but I'm not very familiar with uClibc, so I'm not sure about it.
💔 Test failed - checks-actions |
You need to change libc-test/build.rs to include the statx header file in the C tests. |
Ping @alyssais, could you address the above comment? |
☔ The latest upstream changes (presumably #2808) made this pull request unmergeable. Please resolve the merge conflicts. |
src/unix/linux_like/linux/mod.rs
Outdated
pub fn statx( | ||
dirfd: ::c_int, | ||
pathname: *const c_char, | ||
flags: ::c_int, | ||
mask: ::c_uint, | ||
statxbuf: *mut statx, | ||
) -> ::c_int; | ||
|
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.
AFIAK the current version of musl (1.2.3) doesn't implement a wrapper forSYS_statx
.
But, I think it's worth leaving the rest (struct statx, constant, etc) available for all linux target
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.
My mistake, you're correct.
I'm quite interested in this PR |
I've rebased the PR and updated it to drop the statx function, which as @germag pointed out, I was wrong about being present on Musl. Hopefully this also avoids the need to add a header to build.rs, although I'm not sure. |
Thinking about it some more, is it right to expose even the structs if Musl doesn't? I thought it did, but it turns out the |
if that were to happen, which I don't think it would, they would be incompatible with both the glibc and linux, since the |
sorry for stepping in, are there any additional problems with this PR? |
The diff doesn't include the change mentioned above, have you tested that libc-test passes? |
☔ The latest upstream changes (presumably #2941) made this pull request unmergeable. Please resolve the merge conflicts. |
I followed up on this in the #musl IRC channel, and the consensus there was that there's no guarantee that kernel headers and libc headers will be compatible for the same functionality, and that the libc crate probably shouldn't expose interfaces that come straight from the kernel but are not exposed by libc. If libc does this in other places, then maybe it's okay, but I'd really like to hear the thoughts of a libc crate maintainer on this specific issue before I go further with this, since I'm not confident it's the way to go. |
Mmm. I don't think we should be exposing this for all Linux targets. Mister Musl is correct, here. For instance, there's |
Triage: The arguments above make some sense to me. Let's close this PR for now and continue the discussion if someone wants to support it strongly. Thanks @alyssais for the PR anyway! |
I think all this should be available on all Linux targets now, but I'm not very familiar with uClibc, so I'm not sure about it.