From a4f82c060ea232d998a7d1162768b4efb9dfd67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 16 Sep 2006 19:26:48 +0000 Subject: Provide an --enable-mmap switch to enable mmap, and default to the previous behaviour (no-mmap). Problems to fix before enabling mmap() again: - SIGBUS when the file disappears (if can be worked around, low priority); - the size of the mmap()ed file is a constant, if the file is open for appending by another process mmap() should not be used; - there's a pointless memcpy() in the cache plugin that should be avoided for mmap() files. CVS patchset: 8267 CVS date: 2006/09/16 19:26:48 --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 431fb6b8b..b17515b03 100644 --- a/configure.ac +++ b/configure.ac @@ -1921,6 +1921,16 @@ else fi AC_SUBST(W32DLL_DEP) +dnl -------------------------------------------- +dnl mmap() support +dnl -------------------------------------------- + +AC_ARG_ENABLE([mmap], + AS_HELP_STRING([--enable-mmap], [Enable mmap() file loading (default: no)])) + +if test "x$enable_mmap" = "xyes"; then + AC_CHECK_FUNCS([mmap]) +fi dnl --------------------------------------------- dnl ip_mreqn @@ -1938,7 +1948,7 @@ dnl --------------------------------------------- AC_SYS_LARGEFILE AC_CHECK_LIB(posix4, sched_get_priority_min) -AC_CHECK_FUNCS([_vsnprintf _snprintf _stricmp _strnicmp vsscanf sigaction sigset getpwuid_r nanosleep lstat memset readlink strchr strcasecmp strncasecmp mmap]) +AC_CHECK_FUNCS([_vsnprintf _snprintf _stricmp _strnicmp vsscanf sigaction sigset getpwuid_r nanosleep lstat memset readlink strchr strcasecmp strncasecmp]) AC_FUNC_FSEEKO AC_DEFINE(_GNU_SOURCE) AC_CHECK_HEADERS(assert.h byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h netdb.h dirent.h sys/times.h sys/ioctl.h sys/param.h) -- cgit v1.2.3