summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-07-02 12:43:09 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-07-05 13:03:19 -0700
commit0fdf6c9db5114c77cd846c71699eb877d41ad6ae (patch)
treecba5c252006d162ce2dc3431bc1464b2d1f50df8 /libglusterfs
parent78232678ad45cf8d12b991ea1ff441fbcdc3a601 (diff)
build: Mac OS X build issues, no spinlock, need sys_lgetxattr
use regular locks, use our syscall wrappers in libglusterfs Change-Id: I7e0d00956366806af041b69b65d1f169aa0d2ae2 BUG: 1238793 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/11515 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/locking.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libglusterfs/src/locking.h b/libglusterfs/src/locking.h
index a66cdc188db..24edf9aed44 100644
--- a/libglusterfs/src/locking.h
+++ b/libglusterfs/src/locking.h
@@ -12,6 +12,15 @@
#define _LOCKING_H
#include <pthread.h>
+#ifdef GF_DARWIN_HOST_OS
+#include <libkern/OSAtomic.h>
+#define pthread_spinlock_t OSSpinLock
+#define pthread_spin_lock(l) OSSpinLockLock(l)
+#define pthread_spin_unlock(l) OSSpinLockUnlock(l)
+#define pthread_spin_destroy(l) 0
+#define pthread_spin_init(l, v) (*l = v)
+#endif
+
#if HAVE_SPINLOCK
#define LOCK_INIT(x) pthread_spin_init (x, 0)