summaryrefslogtreecommitdiff
path: root/lang/mono/patches/patch-bf
blob: 0c7d7124879e1b8e0af6f1fab3eb367697443358 (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
$NetBSD: patch-bf,v 1.1 2007/08/13 16:41:34 taca Exp $

--- support/map.c.orig	2006-04-11 07:21:37.000000000 +0900
+++ support/map.c
@@ -4672,15 +4672,23 @@ int Mono_Posix_ToMountFlags (guint64 x, 
 
 int Mono_Posix_FromMremapFlags (guint64 x, guint64 *r)
 {
+#ifdef __NetBSD__
+	*r = MAP_FIXED;
+#else
 	*r = 0;
+#endif
 	if (x == 0)
 		return 0;
 	if ((x & Mono_Posix_MremapFlags_MREMAP_MAYMOVE) == Mono_Posix_MremapFlags_MREMAP_MAYMOVE)
+#ifdef __NetBSD__
+		*r &= ~MAP_FIXED;
+#else
 #ifdef MREMAP_MAYMOVE
 		*r |= MREMAP_MAYMOVE;
 #else /* def MREMAP_MAYMOVE */
 		{errno = EINVAL; return -1;}
 #endif /* ndef MREMAP_MAYMOVE */
+#endif /* NetBSD */
 	return 0;
 }