From a3cb38e3edf005bef73da4c9cfd958474a14d50f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 17 Apr 2014 15:54:34 -0700 Subject: build: MacOSX Porting fixes git@forge.gluster.org:~schafdog/glusterfs-core/osx-glusterfs Working functionality on MacOSX - GlusterD (management daemon) - GlusterCLI (management cli) - GlusterFS FUSE (using OSXFUSE) - GlusterNFS (without NLM - issues with rpc.statd) Change-Id: I20193d3f8904388e47344e523b3787dbeab044ac BUG: 1089172 Signed-off-by: Harshavardhana Signed-off-by: Dennis Schafroth Tested-by: Harshavardhana Tested-by: Dennis Schafroth Reviewed-on: http://review.gluster.org/7503 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/compat.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/compat.h') diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index 359a4a3b5cf..81408dbd0ae 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -31,11 +31,21 @@ #include #include #include +#include #include #ifdef HAVE_LINUX_FALLOC_H #include #endif +#ifdef HAVE_ENDIAN_H +#include +#endif +#endif /* GF_LINUX_HOST_OS */ + +#ifdef HAVE_XATTR_H +#include +#endif + /* * Define the fallocate flags in case we do not have the header. This also * accounts for older systems that do not define FALLOC_FL_PUNCH_HOLE. @@ -61,7 +71,29 @@ #define lsetxattr(path,key,value,size,flags) setxattr(path,key,value,size,flags) #endif /* HAVE_LLISTXATTR */ -#endif /* GF_LINUX_HOST_OS */ + + +#ifdef GF_DARWIN_HOST_OS +#include +#include + +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htole16(x) OSSwapHostToLittleInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) + +#define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) + +#define htobe64(x) OSSwapHostToBigInt64(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) + +#endif + #ifdef GF_BSD_HOST_OS /* In case of FreeBSD and NetBSD */ @@ -125,12 +157,29 @@ enum { #endif /* GF_BSD_HOST_OS */ #ifdef GF_DARWIN_HOST_OS +#include +#include + +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htole16(x) OSSwapHostToLittleInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) + +#define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) + +#define htobe64(x) OSSwapHostToBigInt64(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) #define UNIX_PATH_MAX 104 +#define AT_SYMLINK_NOFOLLOW 0x100 #include #include -#include #include #include -- cgit