changeset 14566:f38a2658bdd4

better test for MAP_FAILED by Ian Lindsay
author alex
date Fri, 21 Jan 2005 21:32:15 +0000
parents 1a13df0d4fc2
children f525cb411927
files configure
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Fri Jan 21 21:11:35 2005 +0000
+++ b/configure	Fri Jan 21 21:32:15 2005 +0000
@@ -2618,6 +2618,19 @@
 fi
 echores "$_mman"
 
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+int main(void) { void *p = MAP_FAILED; return 0; }
+EOF
+_mman_has_map_failed=no
+cc_check && _mman_has_map_failed=yes
+if test "$_mman_has_map_failed" = yes ; then
+  _def_mman_has_map_failed=''
+else
+  _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
+fi
+
 echocheck "dynamic loader"
 cat > $TMPC << EOF
 #include <dlfcn.h>
@@ -6806,11 +6819,6 @@
 /* use GNU internationalization */
 $_def_i18n
 
-/* missing mmap function on libc5 systems */
-#ifndef MAP_FAILED
-# define MAP_FAILED     ((void *) -1)
-#endif
-
 /* Runtime CPU detection */
 $_def_runtime_cpudetection
 
@@ -6977,6 +6985,7 @@
 
 /* Define this if your system has the "sys/mman.h" header file */
 $_def_mman
+$_def_mman_has_map_failed
 
 /* Define this if you have the elf dynamic linker -ldl library */
 $_def_dl