This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] weaken the MMAP check


Hello,

this patch weakens the MMAP check. We only need MMAP with mmap chosen address ranges, no FIXED one. On HP-UX PA MAP_FIXED does not work.
To run gcj_dbtool we fail here on HP-UX PA with an mmap not implemented exception. This patch makes it work.


Ok for trunk ?

Andreas

2006-04-17 Andreas Tobler <a.tobler@schweiz.ch>

	* configure.ac: Weaken the check for MMAP.
	* configure: Rebuilt.


Index: configure.ac =================================================================== --- configure.ac (revision 113010) +++ configure.ac (working copy) @@ -1346,8 +1346,32 @@ [AC_MSG_RESULT(no)])])])

 AC_FUNC_ALLOCA
-AC_FUNC_MMAP

+dnl Check for mmap()
+# AC_FUNC_MMAP goes to far and checks for mmap fixed, we do only need mmap
+# at a mmap selected address. See
+# gnu/java/nio/channels/natFileChannelPosix.cc
+
+AC_MSG_CHECKING([for mmap])
+AC_CACHE_VAL(ac_cv_func_mmap_ok,
+ [AC_TRY_LINK(
+ changequote(<<, >>)dnl
+ <<
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+ >>,
+ changequote([, ])dnl
+ [mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
+ ac_cv_func_mmap_ok=yes,
+ ac_cv_func_mmap_ok=no)] )
+AC_MSG_RESULT($ac_cv_func_mmap_ok)
+if test $ac_cv_func_mmap_ok = yes
+then
+ AC_DEFINE(HAVE_MMAP, 1, [ Define to 1 if you have a working `mmap' system call w/o fixed address ability.])
+fi
+
AC_CHECK_PROGS(PERL, perl, false)


SYSDEP_SOURCES=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]