Fixes for running FreeBSD buildworld on Linux/macOS hosts
Adding an #ifdef __FreeBSD__ to a FreeBSD-specific header may seem odd, but these headers are used on non-FreeBSD systems during the bootstrap tools phase. Originally submitted downstream as https://reviews.freebsd.org/D26193 Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> Closes #10863
This commit is contained in:
parent
36f36610c3
commit
e28635396a
|
@ -206,8 +206,10 @@ typedef int enum_t;
|
||||||
#define __XSI_VISIBLE 1000
|
#define __XSI_VISIBLE 1000
|
||||||
#endif
|
#endif
|
||||||
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
|
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
|
||||||
#define open64 open
|
|
||||||
#define mmap64 mmap
|
#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 pwrite64 pwrite
|
||||||
#define ftruncate64 ftruncate
|
#define ftruncate64 ftruncate
|
||||||
#define lseek64 lseek
|
#define lseek64 lseek
|
||||||
|
@ -217,6 +219,7 @@ typedef int enum_t;
|
||||||
#define statfs64 statfs
|
#define statfs64 statfs
|
||||||
#define readdir64 readdir
|
#define readdir64 readdir
|
||||||
#define dirent64 dirent
|
#define dirent64 dirent
|
||||||
|
#endif
|
||||||
#define P2ALIGN(x, align) ((x) & -(align))
|
#define P2ALIGN(x, align) ((x) & -(align))
|
||||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include_next <sys/stat.h>
|
#include_next <sys/stat.h>
|
||||||
|
|
||||||
|
/* Note: this file can be used on linux/macOS when bootstrapping tools. */
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
#include <sys/mount.h> /* for BLKGETSIZE64 */
|
#include <sys/mount.h> /* for BLKGETSIZE64 */
|
||||||
|
|
||||||
#define stat64 stat
|
#define stat64 stat
|
||||||
|
@ -68,4 +70,5 @@ fstat64_blk(int fd, struct stat64 *st)
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
#endif /* defined(__FreeBSD__) */
|
||||||
#endif /* _LIBSPL_SYS_STAT_H */
|
#endif /* _LIBSPL_SYS_STAT_H */
|
||||||
|
|
Loading…
Reference in New Issue