• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
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,
8[ 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])
17])
18if test "$ac_cv_header_mmap_anon" = yes; then
19   AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
20fi
21])
22