From 4279777f470d7a5b75e9cf222d18f50e553cd8aa Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 14 Jul 2009 15:31:03 -0700 Subject: [PATCH] Fixed the zpool and zfs commands returning 'internal error: Out of memory.' due to a failure in nvlist_common(). The failure turned out to be missing macro definitions for little endian and big endian. Signed-off-by: Brian Behlendorf --- lib/libspl/include/sys/isa_defs.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/libspl/include/sys/isa_defs.h b/lib/libspl/include/sys/isa_defs.h index 65e695adeb..677e4fda0c 100644 --- a/lib/libspl/include/sys/isa_defs.h +++ b/lib/libspl/include/sys/isa_defs.h @@ -50,6 +50,10 @@ extern "C" { #define _LP64 #endif +#if !defined(_LITTLE_ENDIAN) +#define _LITTLE_ENDIAN +#endif + #define _SUNOS_VTOC_16 /* i386 arch specific defines */ @@ -67,6 +71,10 @@ extern "C" { #define _ILP32 #endif +#if !defined(_LITTLE_ENDIAN) +#define _LITTLE_ENDIAN +#endif + #define _SUNOS_VTOC_16 /* powerpc arch specific defines */ @@ -88,6 +96,10 @@ extern "C" { #endif #endif +#if !defined(_BIG_ENDIAN) +#define _BIG_ENDIAN +#endif + #define _SUNOS_VTOC_16 #else /* Currently only x86_64, i386, and powerpc arches supported */ @@ -98,6 +110,14 @@ extern "C" { #error "Both _ILP32 and _LP64 are defined" #endif +#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN) +#error "Both _LITTLE_ENDIAN and _BIG_ENDIAN are defined" +#endif + +#if !defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +#error "Neither _LITTLE_ENDIAN nor _BIG_ENDIAN are defined" +#endif + #ifdef __cplusplus } #endif