$NetBSD: patch-ae,v 1.2 2008/11/06 08:33:31 bjs Exp $ --- src/util/memory.c.orig 2008-09-21 04:45:22.000000000 -0400 +++ src/util/memory.c @@ -21,6 +21,12 @@ #include "util/error.h" #include "util/memory.h" +#if defined(__NetBSD__) +# define MREMAP(p, oldsz, newsz, f) mremap(p, oldsz, p, newsz, f) +# define MREMAP_MAYMOVE 0 +#else +# define MREMAP(p, oldsz, newsz, f) mremap(p, oldsz, newsz, f) +#endif #if !defined(DEBUG_MEMLEAK) && !defined(CONFIG_FASTMEM) @@ -181,7 +187,7 @@ mem_mmap_realloc(void *p, size_t old_siz if (new_size) { #ifdef HAVE_MREMAP - void *p2 = mremap(p, round_size(old_size), round_size(new_size), MREMAP_MAYMOVE); + void *p2 = MREMAP(p, round_size(old_size), round_size(new_size), MREMAP_MAYMOVE); if (p2 != MAP_FAILED) return p2;