mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-10 20:36:21 +03:00
Provide loff_t via <fcntl.h> on musl-based Linux systems
Musl exposes loff_t only as a macro in <fcntl.h> when _GNU_SOURCE is defined. Including <fcntl.h> ensures the type is available, and a fallback typedef is provided when no macro is defined. This fixes build failures on musl systems. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <robn@despairlabs.com> Signed-off-by: Alexander Moch <mail@alexmoch.com> Closes #18002
This commit is contained in:
parent
ffaea08319
commit
05e2747bf2
@ -54,4 +54,15 @@ typedef int projid_t;
|
|||||||
typedef off_t loff_t;
|
typedef off_t loff_t;
|
||||||
#endif
|
#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 <fcntl.h>
|
||||||
|
#ifndef loff_t
|
||||||
|
typedef off_t loff_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user