summaryrefslogtreecommitdiff
path: root/x11/libxshmfence/patches/patch-src_xshmfence_futex_h
blob: 99e2a7a3854255da54498ae1ac765ef9d4f15283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$OpenBSD$

Index: src/xshmfence_futex.h
--- src/xshmfence_futex.h.orig
+++ src/xshmfence_futex.h
@@ -26,7 +26,21 @@
 
 #include <errno.h>
 
-#ifdef HAVE_UMTX
+#ifdef HAVE_FUTEX
+
+#include <sys/time.h>
+#include <sys/futex.h>
+#include <limits.h>
+
+static inline int futex_wake(int32_t *addr) {
+	return futex(addr, FUTEX_WAKE, INT_MAX, NULL, NULL);
+}
+
+static inline int futex_wait(int32_t *addr, int32_t value) {
+	return futex(addr, FUTEX_WAIT, value, NULL, NULL);
+}
+
+#elif HAVE_UMTX
 
 #include <sys/types.h>
 #include <sys/umtx.h>