diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/types32.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/types32.h index 5b713192346..cb2ef27cf93 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/types32.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/types32.h @@ -30,9 +30,10 @@ #ifndef _SPL_TYPES32_H #define _SPL_TYPES32_H +#include + typedef uint32_t caddr32_t; typedef int32_t daddr32_t; -typedef int32_t time32_t; typedef uint32_t size32_t; #endif /* _SPL_TYPES32_H */ diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h index 1bcae20187a..850435b29f2 100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/types32.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/types32.h @@ -63,7 +63,12 @@ typedef uint32_t dev32_t; typedef int32_t pid32_t; typedef uint32_t size32_t; typedef int32_t ssize32_t; +#ifdef __FreeBSD__ +#include +#endif +#ifndef __HAVE_TIME32_T typedef int32_t time32_t; +#endif typedef int32_t clock32_t; typedef struct timespec32 { diff --git a/sys/sys/abi_compat.h b/sys/sys/abi_compat.h index 69fb349edc7..f190dcda9b6 100644 --- a/sys/sys/abi_compat.h +++ b/sys/sys/abi_compat.h @@ -52,11 +52,16 @@ typedef struct { #endif } freebsd32_uint64_t; -#ifdef __amd64__ +#if __SIZEOF_LONG__ == 8 +#if defined __amd64__ typedef __int32_t time32_t; #else typedef __int64_t time32_t; #endif +#else +typedef __int32_t time32_t; +#endif +#define __HAVE_TIME32_T #define PTRIN(v) (void *)(uintptr_t)(v) #define PTROUT(v) (uintptr_t)(v)