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 copy_file_range to linux_like #1704

Merged
merged 1 commit into from Mar 27, 2020
Merged

Add copy_file_range to linux_like #1704

merged 1 commit into from Mar 27, 2020

Conversation

slp
Copy link
Contributor

@slp slp commented Mar 20, 2020

It was already present as a syscall, and both glibc and musl support
it, so add its function definition to export it to crate users.

Signed-off-by: Sergio Lopez slp@redhat.com

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@JohnTitor
Copy link
Member

Hm, I think Android should have that but CI failed, maybe SDK version or something else is wrong? If you don't need that in Android or emscripten right now, I'd suggest putting that in linux_like/linux/.
Also, musl targets failed to link. We use musl 1.1.24 on our CI, does that version have copy_file_range?

@slp
Copy link
Contributor Author

slp commented Mar 23, 2020

Hm, I think Android should have that but CI failed, maybe SDK version or something else is wrong? If you don't need that in Android or emscripten right now, I'd suggest putting that in linux_like/linux/.

Yes, Linux would be enough for now, thanks.

Also, musl targets failed to link. We use musl 1.1.24 on our CI, does that version have copy_file_range?

This is weird. According to musl's WHATSNEW, it was added on 1.1.24:

1.1.24 release notes

new features:
- GLOB_TILDE extension to glob
- non-stub catgets localization API, using netbsd binary catalog format
- posix_spawn file actions for [f]chdir (extension, pending future standard)
- secure_getenv function (extension)
- copy_file_range syscall wrapper (Linux extension)
- header-level support for new linux features in 5.2

@slp
Copy link
Contributor Author

slp commented Mar 24, 2020

I've reproduced the issue in a VM. I suspect the problem is that, despite installing musl 1.1.24 on the container, Rust is using the libc bundled with the x86_64-unknown-linux-musl.

Should I add it to src/unix/linux_like/linux/gnu/, or just wait for an update of the CI platform?

@JohnTitor
Copy link
Member

Should I add it to src/unix/linux_like/linux/gnu/, or just wait for an update of the CI platform?

I'm on a break now and unsure that I have time to investigate/tweak CI atm. So the former is a better option for me.

This is a Linux-only feature that was already present as a
syscall. Add it just to linux/gnu for the moment, as the musl version
bundled in the Rust's x86_64-unknown-linux-musl toolchain doesn't
include it yet.

Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp
Copy link
Contributor Author

slp commented Mar 25, 2020

Should I add it to src/unix/linux_like/linux/gnu/, or just wait for an update of the CI platform?

I'm on a break now and unsure that I have time to investigate/tweak CI atm. So the former is a better option for me.

Works for me 👍

@JohnTitor
Copy link
Member

The failures are unrelated, closing/re-opening to re-trigger CI...

@JohnTitor JohnTitor closed this Mar 27, 2020
@JohnTitor JohnTitor reopened this Mar 27, 2020
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JohnTitor JohnTitor merged commit 55a5eb8 into rust-lang:master Mar 27, 2020
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.

None yet

3 participants