From 8d5e7321862db54f9db4ad5cb2d909933581dca3 Mon Sep 17 00:00:00 2001 From: Todd Vierling Date: Wed, 27 Aug 2003 23:11:05 +0000 Subject: [PATCH] Use MAP_TRYFIXED on NetBSD if available. --- libs/wine/loader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c index 2164657504d..efc7a7e94d0 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -428,7 +428,7 @@ void wine_init( int argc, char *argv[], char *error, int error_size ) } -#if defined(__svr4__) || defined(__NetBSD__) +#if (defined(__svr4__) || defined(__NetBSD__)) && !defined(MAP_TRYFIXED) /*********************************************************************** * try_mmap_fixed * @@ -506,7 +506,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags, return result == addr; } -#endif /* __svr4__ || __NetBSD__ */ +#endif /* (__svr4__ || __NetBSD__) && !MAP_TRYFIXED */ /*********************************************************************** @@ -541,7 +541,10 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags ) flags |= MAP_PRIVATE; #endif -#if defined(__svr4__) || defined(__NetBSD__) +#ifdef MAP_TRYFIXED + /* If available, this will attempt a fixed mapping in-kernel */ + flags |= MAP_TRYFIXED; +#elif defined(__svr4__) || defined(__NetBSD__) if ( try_mmap_fixed( start, size, prot, flags, fdzero, 0 ) ) return start; #endif