2013-09-26 17:14:40 +02:00

37 lines
878 B
Plaintext

$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 */