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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
$NetBSD: patch-configure,v 1.1 2012/10/20 00:55:06 wiz Exp $
Whilst reading through other users of XShm, it became apparent that
IPC_RMID behaves differently across the platforms. Linux allows
processes to attach to an existing ShmSegment id after a IPC_RMID, but
for others the IPC_RMID takes immediate effect. On those platforms
without a "deferred" IPC_RMID, we then need to perform the XShmAttach
synchronously before perfomring the IPC_RMID.
Reported-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
--- configure.orig 2012-10-05 15:45:31.000000000 +0000
+++ configure
@@ -21646,6 +21646,65 @@ $as_echo "yes" >&6; }
:
fi
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ipc_h" = xyes; then :
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_shm_h" = xyes; then :
+
+fi
+
+
+
+ if test "$ac_cv_header_sys_ipc_h" = "yes" -a "$ac_cv_header_sys_shm_h" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shmctl IPC_RMID allowes subsequent attaches" >&5
+$as_echo_n "checking whether shmctl IPC_RMID allowes subsequent attaches... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
+$as_echo "assuming no" >&6; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/shm.h>
+ int main()
+ {
+ char *shmaddr;
+ int id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
+ if (id == -1) return 2;
+ shmaddr = shmat (id, 0, 0);
+ shmctl (id, IPC_RMID, 0);
+ if ((char*) shmat (id, 0, 0) == (char*) -1) {
+ shmdt (shmaddr);
+ return 1;
+ }
+ shmdt (shmaddr);
+ shmdt (shmaddr);
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+$as_echo "#define IPC_RMID_DEFERRED_RELEASE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cairo's Xlib surface backend feature could be enabled" >&5
$as_echo_n "checking whether cairo's Xlib surface backend feature could be enabled... " >&6; }
|