PageRenderTime 24ms CodeModel.GetById 23ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/3rd_party/llvm/autoconf/m4/header_mmap_anonymous.m4

https://code.google.com/p/softart/
m4 | 21 lines | 15 code | 0 blank | 6 comment | 0 complexity | 70779176bf3caf5661204cf8be2460f7 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, JSON, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0, LGPL-3.0, BSD-2-Clause
 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])