Issue #255 (bdwgc).
Without this patch, GC_remap() works on NetBSD which has the PaX feature
only if PaX MPROTECT is off (sysctl -w security.pax.mprotect.enabled=0).
* os_dep.c [USE_MUNMAP && !USE_WINALLOC && NETBSD] (GC_remap): Call
mmap() instead of mprotect().
# else
/* It was already remapped with PROT_NONE. */
{
-# ifdef NACL
+# if defined(NACL) || defined(NETBSD)
/* NaCl does not expose mprotect, but mmap should work fine. */
+ /* In case of NetBSD, mprotect fails (unlike mmap) even */
+ /* without PROT_EXEC if PaX MPROTECT feature is enabled. */
void *result = mmap(start_addr, len, (PROT_READ | PROT_WRITE)
| (GC_pages_executable ? PROT_EXEC : 0),
MAP_PRIVATE | MAP_FIXED | OPT_MAP_ANON,