SUBDIRS = src src/gfdb CLEANFILES = ed Hat, Inc. This file is part of GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. */ #ifndef __COMPAT_H__ #define __COMPAT_H__ #ifndef _CONFIG_H #define _CONFIG_H #include "config.h" #endif #include #include "dict.h" #ifndef LLONG_MAX #define LLONG_MAX __LONG_LONG_MAX__ /* compat with old gcc */ #endif /* LLONG_MAX */ #ifdef GF_LINUX_HOST_OS #define UNIX_PATH_MAX 108 #include #include #include #include #ifdef HAVE_LINUX_FALLOC_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. */ #ifndef FALLOC_FL_KEEP_SIZE #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ #endif #ifndef FALLOC_FL_PUNCH_HOLE #define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */ #endif #ifndef HAVE_LLISTXATTR /* This part is valid only incase of old glibc which doesn't support * 'llistxattr()' system calls. */ #define lremovexattr(path,key) removexattr(path,key) #define llistxattr(path,key,size) listxattr(path,key,size) #define lgetxattr(path, key, value, size) getxattr(path,key,value,size) #define lsetxattr(path,key,value,size,flags) setxattr(path,key,value,size,flags) #endif /* HAVE_LLISTXATTR */ #endif /* GF_LINUX_HOST_OS */ #ifdef GF_BSD_HOST_OS /* In case of FreeBSD and NetBSD */ #define UNIX_PATH_MAX 104 #include #include #include #include #ifdef HAVE_SYS_XATTR_H #include #endif /* HAVE_SYS_XATTR_H */ #include #include #ifndef XATTR_CREATE enum { ATTR_CREATE = 1, #define XATTR_CREATE ATTR_CREATE ATTR_REPLACE = 2 #define XATTR_REPLACE ATTR_REPLACE }; #endif /* XATTR_CREATE */ #ifndef sighandler_t #define sighandler_t sig_t #endif #ifndef ino64_t #define ino64_t ino_t #endif #ifndef EUCLEAN #define EUCLEAN 0 #endif #include #ifndef s6_addr16 #define s6_addr16 __u6_addr.__u6_addr16 #endif #ifndef s6_addr32 #define s6_addr32 __u6_addr.__u6_addr32 #endif /* Posix dictates NAME_MAX to be used */ # ifndef NAME_MAX # ifdef MAXNAMLEN # define NAME_MAX MAXNAMLEN # else # define NAME_MAX 255 # endif # endif #define F_GETLK64 F_GETLK #define F_SETLK64 F_SETLK #define F_SETLKW64 F_SETLKW #endif /* GF_BSD_HOST_OS */ #ifdef GF_DARWIN_HOST_OS #define UNIX_PATH_MAX 104 #include #include #include #include #include #include #if __DARWIN_64_BIT_INO_T == 0 # error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"' #endif /* __DARWIN_64_BIT_INO_T */ #if __DARWIN_64_BIT_INO_T == 0 # error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"' #endif /* __DARWIN_64_BIT_INO_T */ #ifndef sighandler_t #define sighandler_t sig_t #endif #ifndef EUCLEAN #define EUCLEAN 0 #endif #include #ifndef s6_addr16 #define s6_addr16 __u6_addr.__u6_addr16 #endif #ifndef s6_addr32 #define s6_addr32 __u6_addr.__u6_addr32 #endif /* Posix dictates NAME_MAX to be used */ # ifndef NAME_MAX # ifdef MAXNAMLEN # define NAME_MAX MAXNAMLEN # else # define NAME_MAX 255 # endif # endif #define F_GETLK64 F_GETLK #defi