projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[reflection] Use coop handles for MonoMethod icalls (#4272)
[mono.git]
/
support
/
sys-mman.c
diff --git
a/support/sys-mman.c
b/support/sys-mman.c
index f885d11b82195f45ff638b940222c82000e1882b..1dd61bc372b5343cce83bf8a677c190aca969a05 100644
(file)
--- a/
support/sys-mman.c
+++ b/
support/sys-mman.c
@@
-7,7
+7,11
@@
* Copyright (C) 2004-2006 Jonathan Pryor
*/
* Copyright (C) 2004-2006 Jonathan Pryor
*/
+#include <config.h>
+
+#ifndef __OpenBSD__
#define _XOPEN_SOURCE 600
#define _XOPEN_SOURCE 600
+#endif
#ifdef PLATFORM_MACOSX
/* For mincore () */
#ifdef PLATFORM_MACOSX
/* For mincore () */
@@
-18,6
+22,11
@@
#define __BSD_VISIBLE 1
#endif
#define __BSD_VISIBLE 1
#endif
+#ifdef __NetBSD__
+/* For mincore () */
+#define _NETBSD_SOURCE
+#endif
+
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
@@
-105,8
+114,15
@@
Mono_Posix_Syscall_mremap (void *old_address, mph_size_t old_size,
if (Mono_Posix_FromMremapFlags (flags, &_flags) == -1)
return MAP_FAILED;
if (Mono_Posix_FromMremapFlags (flags, &_flags) == -1)
return MAP_FAILED;
+#if defined(linux)
return mremap (old_address, (size_t) old_size, (size_t) new_size,
(unsigned long) _flags);
return mremap (old_address, (size_t) old_size, (size_t) new_size,
(unsigned long) _flags);
+#elif defined(__NetBSD__)
+ return mremap (old_address, (size_t) old_size, old_address,
+ (size_t) new_size, (unsigned long) _flags);
+#else
+#error Port me
+#endif
}
#endif /* def HAVE_MREMAP */
}
#endif /* def HAVE_MREMAP */