On HP-UX 11, anonymous mmap is possible, through the MAP_ANONYMOUS flag. But gl_FUNC_MMAP_ANON does not define HAVE_MAP_ANONYMOUS on this platform. Why? Because HAVE_MMAP is not defined - a consequence of the strict test in AC_FUNC_MMAP, combined with the missing support for MAP_FIXED in HP-UX. (The AC_FUNC_MMAP test fails here:
if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; ) This fixes the MAP_ANONYMOUS detection. 2009-05-12 Bruno Haible <br...@clisp.org> Make the MAP_ANONYMOUS detection work on HP-UX 11. * m4/mmap-anon.m4 (gl_FUNC_MMAP_ANON): Check whether mmap exists, but not whether its fully works. --- m4/mmap-anon.m4.orig 2009-05-13 02:27:46.000000000 +0200 +++ m4/mmap-anon.m4 2009-05-13 02:25:58.000000000 +0200 @@ -1,4 +1,4 @@ -# mmap-anon.m4 serial 6 +# mmap-anon.m4 serial 7 dnl Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,12 +22,14 @@ dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - # Check for mmap() - AC_FUNC_MMAP + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no]) # Try to allow MAP_ANONYMOUS. gl_have_mmap_anonymous=no - if test $ac_cv_func_mmap_fixed_mapped = yes; then + if test $gl_have_mmap = yes; then AC_MSG_CHECKING([for MAP_ANONYMOUS]) AC_EGREP_CPP([I cant identify this map.], [ #include <sys/mman.h>