From 826da2a721cbd484e633e7218b6cdc8b364be399 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 27 Dec 2004 06:14:48 +0000 Subject: [PATCH] For PR351: Provide a check to determine if /dev/zero is needed for AllocateRWX function. llvm-svn: 19147 --- llvm/autoconf/m4/need_dev_zero_for_mmap.m4 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 llvm/autoconf/m4/need_dev_zero_for_mmap.m4 diff --git a/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 b/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 new file mode 100644 index 000000000000..352c5186dbf1 --- /dev/null +++ b/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 @@ -0,0 +1,17 @@ +# +# When allocating RWX memory, check whether we need to use /dev/zero +# as the file descriptor or not. +# +AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP], +[AC_CACHE_CHECK([if /dev/zero is needed for mmap], +ac_cv_need_dev_zero_for_mmap, +[if test "$llvm_cv_os_type" == "Interix" ; then + ac_cv_need_dev_zero_for_mmap=yes + else + ac_cv_need_dev_zero_for_mmap=no + fi +]) +if test "$ac_cv_need_dev_zero_for_mmap" = yes; then + AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1], + [Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary]) +fi])