X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fsys-mman.c;h=1dd61bc372b5343cce83bf8a677c190aca969a05;hb=1f45c80ead2421d1dc4d1467dc017c255e96c465;hp=ce804ef6fb5761f85393591ba8562ca9df08df57;hpb=89d5527369717465b43e3145cbecdca3a8601ec4;p=mono.git diff --git a/support/sys-mman.c b/support/sys-mman.c index ce804ef6fb5..1dd61bc372b 100644 --- a/support/sys-mman.c +++ b/support/sys-mman.c @@ -9,7 +9,9 @@ #include +#ifndef __OpenBSD__ #define _XOPEN_SOURCE 600 +#endif #ifdef PLATFORM_MACOSX /* For mincore () */ @@ -20,6 +22,11 @@ #define __BSD_VISIBLE 1 #endif +#ifdef __NetBSD__ +/* For mincore () */ +#define _NETBSD_SOURCE +#endif + #include #include #include @@ -107,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 defined(linux) 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 */