$NetBSD$

--- bsd/memmeter.cc.orig	2002-07-13 23:48:45.000000000 -0400
+++ bsd/memmeter.cc	2006-10-27 22:09:54.000000000 -0400
@@ -77,7 +77,7 @@
   struct vmtotal meminfo;
   int params[] = {CTL_VM, VM_METER};
   size_t meminfosize = sizeof (struct vmtotal);
-  sysctl (params, 2, &meminfo, &meminfosize, NULL, NULL);
+  sysctl (params, 2, &meminfo, &meminfosize, NULL, 0);
   /*  Note that the numbers are in terms of 4K pages.  */
 
   total_ = 4096*(meminfo.t_free+meminfo.t_rm);
@@ -91,8 +91,15 @@
    *  this, and later we'll add all the common fields to this.  */
   total_ = 0.0;
 #if defined(UVM) && (defined(XOSVIEW_NETBSD) || defined(XOSVIEW_OPENBSD))
+#ifdef VM_UVMEXP2
+  int params[] = {CTL_VM, VM_UVMEXP2};
+  struct uvmexp_sysctl kvm_uvm_exp;
+  size_t kvm_uvm_exp_size = sizeof (kvm_uvm_exp);
+  sysctl (params, 2, &kvm_uvm_exp, &kvm_uvm_exp_size, NULL, 0);
+#else
   struct uvmexp kvm_uvm_exp;
   BSDGetUVMPageStats(&kvm_uvm_exp);
+#endif
   int pgsize = kvm_uvm_exp.pagesize;
   fields_[0] = kvm_uvm_exp.active*pgsize;
   fields_[1] = kvm_uvm_exp.inactive*pgsize;
