about summary refs log tree commit diff
path: root/mach
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-02-17 07:30:04 +0000
committerRoland McGrath <roland@gnu.org>2002-02-17 07:30:04 +0000
commit30537cab78969a27a9f045a812e712cd0ebd9c24 (patch)
treef0782ae9a0194723843a1814c03bd90924e4f36a /mach
parent690a2f7da66de6faa69362a42aec6467d58209af (diff)
downloadglibc-30537cab78969a27a9f045a812e712cd0ebd9c24.tar.gz
glibc-30537cab78969a27a9f045a812e712cd0ebd9c24.tar.xz
glibc-30537cab78969a27a9f045a812e712cd0ebd9c24.zip
* 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.
Diffstat (limited to 'mach')
-rw-r--r--mach/mach_init.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mach/mach_init.c b/mach/mach_init.c
index 468aba9025..0dd33e44d9 100644
--- a/mach/mach_init.c
+++ b/mach/mach_init.c
@@ -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)