blob: 2270d29557b68a343729c58aa40efa85a513bf4f [file] [log] [blame]
Reid Spencer491f6812004-09-07 06:56:14 +00001#
2# Check for anonymous mmap macros. This is modified from
3# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
4#
5AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS],
6[AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON,
7ac_cv_header_mmap_anon,
Reid Spencer12de17d2004-09-19 22:31:49 +00008[ AC_LANG_PUSH([C])
9 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
10 [[#include <sys/mman.h>
11#include <unistd.h>
12#include <fcntl.h>]],
13 [[mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);]])],
14 ac_cv_header_mmap_anon=yes,
15 ac_cv_header_mmap_anon=no)
16 AC_LANG_POP([C])
Reid Spencer491f6812004-09-07 06:56:14 +000017])
18if test "$ac_cv_header_mmap_anon" = yes; then
Reid Spencer52f853a2004-12-27 03:14:43 +000019 AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
Reid Spencer491f6812004-09-07 06:56:14 +000020fi
21])