diff --git a/include/os/freebsd/spl/sys/ccompile.h b/include/os/freebsd/spl/sys/ccompile.h index 7268bd1d73..bffe6d21e3 100644 --- a/include/os/freebsd/spl/sys/ccompile.h +++ b/include/os/freebsd/spl/sys/ccompile.h @@ -206,8 +206,10 @@ typedef int enum_t; #define __XSI_VISIBLE 1000 #endif #define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) -#define open64 open #define mmap64 mmap +/* Note: this file can be used on linux/macOS when bootstrapping tools. */ +#if defined(__FreeBSD__) +#define open64 open #define pwrite64 pwrite #define ftruncate64 ftruncate #define lseek64 lseek @@ -217,6 +219,7 @@ typedef int enum_t; #define statfs64 statfs #define readdir64 readdir #define dirent64 dirent +#endif #define P2ALIGN(x, align) ((x) & -(align)) #define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) #define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) diff --git a/lib/libspl/include/os/freebsd/sys/stat.h b/lib/libspl/include/os/freebsd/sys/stat.h index 82c86262ff..07f9762f09 100644 --- a/lib/libspl/include/os/freebsd/sys/stat.h +++ b/lib/libspl/include/os/freebsd/sys/stat.h @@ -28,6 +28,8 @@ #include_next +/* Note: this file can be used on linux/macOS when bootstrapping tools. */ +#if defined(__FreeBSD__) #include /* for BLKGETSIZE64 */ #define stat64 stat @@ -68,4 +70,5 @@ fstat64_blk(int fd, struct stat64 *st) return (0); } +#endif /* defined(__FreeBSD__) */ #endif /* _LIBSPL_SYS_STAT_H */