update Sun May 9 18:37:00 PDT 2010
[pkgsrc.git] / sysutils / xosview / patches / patch-ab
1 $NetBSD: patch-ab,v 1.12 2006/10/28 02:15:12 christos Exp $
2
3 --- bsd/memmeter.cc.orig        2002-07-13 23:48:45.000000000 -0400
4 +++ bsd/memmeter.cc     2006-10-27 22:09:54.000000000 -0400
5 @@ -77,7 +77,7 @@
6    struct vmtotal meminfo;
7    int params[] = {CTL_VM, VM_METER};
8    size_t meminfosize = sizeof (struct vmtotal);
9 -  sysctl (params, 2, &meminfo, &meminfosize, NULL, NULL);
10 +  sysctl (params, 2, &meminfo, &meminfosize, NULL, 0);
11    /*  Note that the numbers are in terms of 4K pages.  */
12  
13    total_ = 4096*(meminfo.t_free+meminfo.t_rm);
14 @@ -91,8 +91,15 @@
15     *  this, and later we'll add all the common fields to this.  */
16    total_ = 0.0;
17  #if defined(UVM) && (defined(XOSVIEW_NETBSD) || defined(XOSVIEW_OPENBSD))
18 +#ifdef VM_UVMEXP2
19 +  int params[] = {CTL_VM, VM_UVMEXP2};
20 +  struct uvmexp_sysctl kvm_uvm_exp;
21 +  size_t kvm_uvm_exp_size = sizeof (kvm_uvm_exp);
22 +  sysctl (params, 2, &kvm_uvm_exp, &kvm_uvm_exp_size, NULL, 0);
23 +#else
24    struct uvmexp kvm_uvm_exp;
25    BSDGetUVMPageStats(&kvm_uvm_exp);
26 +#endif
27    int pgsize = kvm_uvm_exp.pagesize;
28    fields_[0] = kvm_uvm_exp.active*pgsize;
29    fields_[1] = kvm_uvm_exp.inactive*pgsize;