diff --git a/lib/libspl/include/sys/types.h b/lib/libspl/include/sys/types.h index 9af20d781..37cf1d241 100644 --- a/lib/libspl/include/sys/types.h +++ b/lib/libspl/include/sys/types.h @@ -54,4 +54,15 @@ typedef int projid_t; typedef off_t loff_t; #endif +/* + * On musl, loff_t is a macro within fcntl.h when _GNU_SOURCE is defined. + * If no macro is defined, a typedef fallback is provided. + */ +#if defined(__linux__) && !defined(__GLIBC__) +#include +#ifndef loff_t +typedef off_t loff_t; +#endif +#endif + #endif