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
|
$NetBSD: patch-be,v 1.3 2013/06/05 17:03:55 jperkin Exp $
--- support/sys-mman.c.orig 2013-04-25 09:01:57.000000000 +0000
+++ support/sys-mman.c
@@ -7,7 +7,6 @@
* Copyright (C) 2004-2006 Jonathan Pryor
*/
-#define _XOPEN_SOURCE 600
#ifdef PLATFORM_MACOSX
/* For mincore () */
@@ -21,6 +20,9 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
+#ifdef __sun
+#include <unistd.h>
+#endif
#include "map.h"
#include "mph.h"
@@ -105,8 +107,13 @@ Mono_Posix_Syscall_mremap (void *old_add
if (Mono_Posix_FromMremapFlags (flags, &_flags) == -1)
return MAP_FAILED;
+#if defined(__NetBSD__)
+ return mremap (old_address, (size_t) old_size, old_address, (size_t) new_size,
+ (unsigned long) _flags);
+#else
return mremap (old_address, (size_t) old_size, (size_t) new_size,
(unsigned long) _flags);
+#endif
}
#endif /* def HAVE_MREMAP */
|