summaryrefslogtreecommitdiff
path: root/x11/libxshmfence/patches/patch-src_xshmfence_alloc_c
blob: 7e258678bb11994ce355d1ad4908b59f8bb540b2 (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
$OpenBSD$

Index: src/xshmfence_alloc.c
--- src/xshmfence_alloc.c.orig
+++ src/xshmfence_alloc.c
@@ -26,6 +26,10 @@
 
 #include "xshmfenceint.h"
 
+#ifndef __MAP_NOFAULT
+#define __MAP_NOFAULT		0
+#endif
+
 #if !HAVE_MEMFD_CREATE
 #if HAVE_DECL___NR_MEMFD_CREATE
 #include <asm/unistd.h>
@@ -105,7 +109,7 @@ struct xshmfence *
 xshmfence_map_shm(int fd)
 {
 	struct xshmfence *addr;
-	addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+	addr = mmap (NULL, sizeof (struct xshmfence) , PROT_READ|PROT_WRITE, MAP_SHARED | __MAP_NOFAULT, fd, 0);
 	if (addr == MAP_FAILED) {
 		close (fd);
 		return 0;