* config.h.in: Add #undef HAVE_HOST_PAGE_SIZE.
authorRoland McGrath <roland@gnu.org>
Sun, 17 Feb 2002 07:30:04 +0000 (07:30 +0000)
committerRoland McGrath <roland@gnu.org>
Sun, 17 Feb 2002 07:30:04 +0000 (07:30 +0000)
* sysdeps/mach/configure.in: Check for host_page_size RPC to define it.
* mach/mach_init.c (__mach_init) [HAVE_HOST_PAGE_SIZE]: Use
host_page_size instead of vm_statistics.

ChangeLog
config.h.in
mach/mach_init.c
sysdeps/mach/configure.in

index b70cb7264feadd28294698509a5490f8c39148b1..5feb9f265d0b1c9b27389497673440f3de8efac1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-02-16  Roland McGrath  <roland@frob.com>
 
+       * config.h.in: Add #undef HAVE_HOST_PAGE_SIZE.
+       * sysdeps/mach/configure.in: Check for host_page_size RPC to define it.
+       * mach/mach_init.c (__mach_init) [HAVE_HOST_PAGE_SIZE]: Use
+       host_page_size instead of vm_statistics.
+
        * sysdeps/mach/Makefile (mach-before-compile): Don't include
        mach_interface.h here, since not all variants use that name.
 
index b15e8f15ce60e958823cd3655c8b1f70de385ad6..fae29729e405a34edaef1c714bbb6fac3fe11005 100644 (file)
 /* Mach/Hurd specific: define if mig supports the `retcode' keyword.  */
 #undef HAVE_MIG_RETCODE
 
+/* Mach specific: define if the `host_page_size' RPC is available.  */
+#undef HAVE_HOST_PAGE_SIZE
+
 /*
 \f */
 
index 468aba9025114adbb2d5ca06760602507eecd900..0dd33e44d9c68ebadbf24af350249ee9aaf981b4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,93,95,97,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992,93,95,97,2001,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <mach_init.h>
-#include <mach/mach_interface.h>
+#include <mach.h>
 #include <mach/mig_support.h>
 #include <unistd.h>
 
@@ -29,13 +28,20 @@ void
 __mach_init (void)
 {
   kern_return_t err;
-  vm_statistics_data_t stats;
 
   __mach_task_self_ = (__mach_task_self) ();
   __mig_init (0);
 
-  if (err = __vm_statistics (__mach_task_self (), &stats))
+#if HAVE_HOST_PAGE_SIZE
+  if (err = __host_page_size (__mach_host_self (), &__vm_page_size))
     _exit (err);
-  __vm_page_size = stats.pagesize;
+#else
+  {
+    vm_statistics_data_t stats;
+    if (err = __vm_statistics (__mach_task_self (), &stats))
+      _exit (err);
+    __vm_page_size = stats.pagesize;
+  }
+#endif
 }
 weak_alias (__mach_init, mach_init)
index 058a2a05c82b65589f52e1dc7346a616960e5b8e..05dc45b61dde74a0b41e3392faacc88b942a7bbf 100644 (file)
@@ -59,3 +59,12 @@ done
 if test "x$mach_interface_list" = x; then
   AC_MSG_ERROR([what manner of Mach is this?])
 fi
+
+AC_CACHE_CHECK(for host_page_size in mach_host.defs,
+              libc_cv_mach_host_page_size, [dnl
+AC_EGREP_HEADER(host_page_size, mach/mach_host.defs,
+               libc_cv_mach_host_page_size=yes,
+               libc_cv_mach_host_page_size=no)])
+if test $libc_cv_mach_host_page_size = yes; then
+  AC_DEFINE([HAVE_HOST_PAGE_SIZE])
+fi