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:
Alexander Richardson
2020-09-04 04:06:03 +01:00
committed by Brian Behlendorf
parent 36f36610c3
commit e28635396a
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -28,6 +28,8 @@
#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 */
#define stat64 stat
@@ -68,4 +70,5 @@ fstat64_blk(int fd, struct stat64 *st)
return (0);
}
#endif /* defined(__FreeBSD__) */
#endif /* _LIBSPL_SYS_STAT_H */