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

Include sendfile64() for Linux #1944

Merged
merged 1 commit into from
Oct 20, 2020
Merged

Conversation

nroi
Copy link
Contributor

@nroi nroi commented Oct 20, 2020

sendfile uses the off_t type, which is platform dependent. On 64-bit architectures, I can pass an off64_t as the third argument to libc::sendfile, but on 32-bit architectures, this does not compile. sendfile64 on the other hand uses a 64-bit wide offset even on 32-bit architectures, so that off64_t can be used.

Excerpt from man 2 sendfile:

The original Linux sendfile() system call was not designed to handle large file offsets. Consequently, Linux 2.4 added sendfile64(), with a wider type for the offset argument.

I hope that supporting Linux versions below 2.4 is not a requirement for libc.

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

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.

Looks good, thanks!

I hope that supporting Linux versions below 2.4 is not a requirement for libc.

Yeah, it should be fine, I believe.

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 20, 2020

📌 Commit a8c1d97 has been approved by JohnTitor

bors added a commit that referenced this pull request Oct 20, 2020
Rollup of 3 pull requests

Successful merges:

 - #1943 (Add definitions for Linux debug related MAGIC)
 - #1944 (Include sendfile64() for Linux)
 - #1945 (Disable libc-test for MIPS64 for now)

Failed merges:

r? `@ghost`
@bors bors merged commit 419a976 into rust-lang:master Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants