Fix compile errors when targeting musl#590
Conversation
|
Thanks! First of all, on the direction, I have no problems with that, and supporting musl-based systems is a good thing. (Keep in mind we format with Reading the PR in details soon! |
|
@mrakh I have no further comments other than the CI failures. Thanks! |
… when targeting musl
When targeting musl, libc::pthread_t aliases to *mut c_void, which is not Send, and therefore causes compilation failures. pthread_t is meant to be an opaque handle, so we can safely just wrap it in a newtype that explicitly implements Send.
|
Thanks for the feedback! I've reformatted with the nightly version of |
|
I seem to be currently experiencing the same (or similar) issue addressed by this MR in aecd15e |
See #589. This PR contains a few fixes that address some issues that pop up when targeting a
musl-based system:libc::msghdrstruct's reserved/padding fields are marked as private, so the compiler throws an error when trying to initialize an instance oflibc::msghdrwith struct literal syntax. This PR resolves the issue by usingstd::mem::zeroed()instead.libccrate does not contain a struct definition forstatx. This PR resolves the issue by defining thestatxstruct directly inglommio.TMPFS_MAGICis not defined in thenixcrate. This PR resolves the issue by qualifying the constant withlibc, which does define it.libc::pthread_tis a wrapper around*mut c_void, which is notSendand therefore cannot be moved into a thread. This PR resolves the issue by defining and using a wrapper that explicitly implementsSend.