diff options
author | pfg <pfg@FreeBSD.org> | 2017-01-16 03:48:52 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-01-16 03:48:52 +0000 |
commit | 944d86abecb0245442b6d67da7bf0bf85ac6ff5c (patch) | |
tree | fbef1e6be4d23270c3cf6f045b9343fd7457344f /lib/libkvm | |
parent | a93bb23350d7c5e28a97ddc87d44464c5f82a7e7 (diff) | |
download | FreeBSD-src-944d86abecb0245442b6d67da7bf0bf85ac6ff5c.zip FreeBSD-src-944d86abecb0245442b6d67da7bf0bf85ac6ff5c.tar.gz |
MFC r311101:
libkvm - extend a bit the swap statistics field.
Change ksw_used and ksw_total to unsigned, which increases the maximum
total swap that can be displayed properly from ~8TB to ~16TB.
Obtained from: DragonflyBSD (ecc2e461)
Diffstat (limited to 'lib/libkvm')
-rw-r--r-- | lib/libkvm/kvm.h | 8 | ||||
-rw-r--r-- | lib/libkvm/kvm_getswapinfo.3 | 6 | ||||
-rw-r--r-- | lib/libkvm/kvm_getswapinfo.c | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/libkvm/kvm.h b/lib/libkvm/kvm.h index 8b66180..db71bf3 100644 --- a/lib/libkvm/kvm.h +++ b/lib/libkvm/kvm.h @@ -66,11 +66,11 @@ struct proc; struct kvm_swap { char ksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX 0x0002 diff --git a/lib/libkvm/kvm_getswapinfo.3 b/lib/libkvm/kvm_getswapinfo.3 index edd2068..bb4e67e 100644 --- a/lib/libkvm/kvm_getswapinfo.3 +++ b/lib/libkvm/kvm_getswapinfo.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fields: .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El diff --git a/lib/libkvm/kvm_getswapinfo.c b/lib/libkvm/kvm_getswapinfo.c index 16d2076..11a586a 100644 --- a/lib/libkvm/kvm_getswapinfo.c +++ b/lib/libkvm/kvm_getswapinfo.c @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -163,7 +164,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; |