aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/getsysstats.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/getsysstats.c')
-rw-r--r--sysdeps/mach/getsysstats.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c
index e1e467735a..d2bebb621c 100644
--- a/sysdeps/mach/getsysstats.c
+++ b/sysdeps/mach/getsysstats.c
@@ -1,5 +1,5 @@
/* System dependent pieces of sysconf; Mach version
- Copyright (C) 1996, 97, 99, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,99,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
@@ -84,7 +84,17 @@ __get_avphys_pages ()
vm_statistics_data_t vs;
kern_return_t err;
+#ifdef HOST_VM_INFO
+ {
+ mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
+ err = __host_info (__mach_host_self (), HOST_VM_INFO,
+ (host_info_t) &vs, &count);
+ if (!err && count < HOST_VM_INFO_COUNT)
+ err = EGRATUITOUS;
+ }
+#else
err = __vm_statistics (__mach_task_self (), &vs);
+#endif
if (err)
return __hurd_fail (err);