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

copyfile: fix compiling against musl libc #159

Closed
wants to merge 1 commit into from
Closed

copyfile: fix compiling against musl libc #159

wants to merge 1 commit into from

Conversation

pks-t
Copy link

@pks-t pks-t commented May 3, 2017

The native C module for copying files directly in-kernel is using the
loff_t data type, which is defined in fcntl.h. While the file seems to
be indirectly included when building with glibc, it breaks compiling
with musl libc.

Fix the issue by directly including fcntl.h. Define GNU_SOURCE as the
typedef is guarded by this preprocessor macro.

The native C module for copying files directly in-kernel is using the
`loff_t` data type, which is defined in fcntl.h. While the file seems to
be indirectly included when building with glibc, it breaks compiling
with musl libc.

Fix the issue by directly including fcntl.h. Define GNU_SOURCE as the
typedef is guarded by this preprocessor macro.
@zmedico zmedico requested a review from blueness May 5, 2017 18:36
@zmedico
Copy link
Member

zmedico commented May 7, 2017

Can we just replace loff_t with off64_t, so that we can keep things more portable by avoiding the _GNU_SOURCE define?

@blueness
Copy link
Contributor

blueness commented May 7, 2017

Yes, that's an acceptable solution. I tested to make sure.

@zmedico
Copy link
Member

zmedico commented May 7, 2017

I'm thinking with should use off_t along with the Large File Support macros (-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE) in extra_compile_args.

@pks-t
Copy link
Author

pks-t commented May 8, 2017

Just did some quick tests with off_t, works for me. I'm closing this PR in favor of yours. Thanks!

@pks-t pks-t closed this May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants