diff options
| author | Alex Richardson <arichardson@FreeBSD.org> | 2020-08-07 16:03:55 +0000 |
|---|---|---|
| committer | Alex Richardson <arichardson@FreeBSD.org> | 2020-08-07 16:03:55 +0000 |
| commit | ec4deee4e4f2aef1b97d9424f25d04e91fd7dc10 (patch) | |
| tree | 3febc852497d63cfd3b5951bb9df06bc36cc6c6d /sys/cddl/compat | |
| parent | 88d241831d991f7c79242bf0bfe034541d373951 (diff) | |
Notes
Diffstat (limited to 'sys/cddl/compat')
| -rw-r--r-- | sys/cddl/compat/opensolaris/sys/stat.h | 13 | ||||
| -rw-r--r-- | sys/cddl/compat/opensolaris/sys/time.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/stat.h b/sys/cddl/compat/opensolaris/sys/stat.h index d7301841d08b..05b9671789dd 100644 --- a/sys/cddl/compat/opensolaris/sys/stat.h +++ b/sys/cddl/compat/opensolaris/sys/stat.h @@ -32,11 +32,19 @@ #include_next <sys/stat.h> +/* + * When bootstrapping on Linux a stat64/fstat64 functions exists in both + * glibc and musl libc. To avoid compilation errors, use those functions instead + * of redefining them to stat/fstat. + * Similarly, macOS provides (deprecated) stat64 functions that we can use + * for now. + */ +#if !defined(__linux__) && !defined(__APPLE__) #define stat64 stat #define MAXOFFSET_T OFF_MAX -#ifndef _KERNEL +#if !defined(_KERNEL) #include <sys/disk.h> static __inline int @@ -51,6 +59,7 @@ fstat64(int fd, struct stat *sb) } return (ret); } -#endif +#endif /* !defined(_KERNEL) */ +#endif /* !defined(__linux__) && !defined(__APPLE__) */ #endif /* !_COMPAT_OPENSOLARIS_SYS_STAT_H_ */ diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h index 64dd9bb9f918..5f51d08550f4 100644 --- a/sys/cddl/compat/opensolaris/sys/time.h +++ b/sys/cddl/compat/opensolaris/sys/time.h @@ -29,6 +29,7 @@ #ifndef _OPENSOLARIS_SYS_TIME_H_ #define _OPENSOLARIS_SYS_TIME_H_ +#include <sys/types.h> #include_next <sys/time.h> #define SEC 1 |
