summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/compat.h
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2011-08-12 06:46:15 +0200
committerAnand Avati <avati@gluster.com>2011-08-12 05:07:14 -0700
commitc5d7fa2bf4c766200971cfbb877d4a25b3cb32b0 (patch)
tree776af356762df648560367061c2af34c6729f90f /libglusterfs/src/compat.h
parent22105b3c741a26f525e0b31bb3d880c1eaa05c30 (diff)
Build fix for NetBSD
Change-Id: Icb0163d61bfbd3bad520c06a655f80ec05fc3fb2 BUG: 2923 Reviewed-on: http://review.gluster.com/214 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'libglusterfs/src/compat.h')
-rw-r--r--libglusterfs/src/compat.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index a7e5e73b1ea..cb71d32cecc 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -58,7 +58,7 @@
#endif /* GF_LINUX_HOST_OS */
#ifdef GF_BSD_HOST_OS
-/* In case of FreeBSD */
+/* In case of FreeBSD and NetBSD */
#define UNIX_PATH_MAX 104
#include <sys/types.h>
@@ -66,16 +66,21 @@
#include <sys/un.h>
#include <sys/endian.h>
#include <sys/extattr.h>
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif /* HAVE_SYS_XATTR_H */
#include <limits.h>
#include <libgen.h>
+#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
@@ -111,6 +116,13 @@ enum {
#define F_SETLK64 F_SETLK
#define F_SETLKW64 F_SETLKW
+#ifdef __NetBSD__
+char *basename_r(const char *);
+char *dirname_r(char *);
+
+#define basename(path) basename_r(path)
+#define dirname(path) dirname_r(path)
+#endif /* __NetBSD__ */
#endif /* GF_BSD_HOST_OS */
#ifdef GF_DARWIN_HOST_OS