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

Compilation fails when off_t is defined as 32 bit integer #18

Closed
nroi opened this issue Jun 21, 2020 · 1 comment
Closed

Compilation fails when off_t is defined as 32 bit integer #18

nroi opened this issue Jun 21, 2020 · 1 comment

Comments

@nroi
Copy link
Owner

nroi commented Jun 21, 2020

We are currently calling libc::sendfile with an offset of type i64. This works fine on machines where off_t is defined as a 64 bit signed integer, but it fails to compile on other machines (for example, ARM devices like the cubieboard or the Raspberry Pi: #14 (comment)).

Notice the following 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. The glibc sendfile() wrapper function transparently deals with the kernel differences.

By using sendfile64(), compilation should succeed on those devices that have off_t defined as a 32 bit signed integer.

nroi added a commit that referenced this issue Jun 21, 2020
@nroi
Copy link
Owner Author

nroi commented Jun 21, 2020

The issue is solved with da1a3c1, but:

We are now using libc from our own libc repository (forked off the official libc repository). Obviously, we would prefer to use the official libc as dependency. Maybe we should contact the libc maintainers and see if they could include sendfile64(), so that we don't need our own fork.

@nroi nroi closed this as completed Jun 21, 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

No branches or pull requests

1 participant