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.4 2014/08/21 07:49:56 wiz Exp $
--- support/sys-mman.c.orig 2014-08-09 11:10:44.000000000 +0000
+++ support/sys-mman.c
@@ -10,7 +10,6 @@
#include <config.h>
#ifndef __OpenBSD__
-#define _XOPEN_SOURCE 600
#endif
#ifdef PLATFORM_MACOSX
@@ -25,6 +24,9 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
+#ifdef __sun
+#include <unistd.h>
+#endif
#include "map.h"
#include "mph.h"
@@ -109,8 +111,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 */
|