summaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-11-28 12:46:02 +0000
committerru <ru@FreeBSD.org>2006-11-28 12:46:02 +0000
commit3b8270a3d54536f75863cb20eeed53f240d24ba5 (patch)
tree54a4571abbdb6a65f55daa94a9fdb8f8253b31fb /release
parentdec1d110aeb2a55ab4ada2307d9fe7440425153d (diff)
downloadFreeBSD-src-3b8270a3d54536f75863cb20eeed53f240d24ba5.zip
FreeBSD-src-3b8270a3d54536f75863cb20eeed53f240d24ba5.tar.gz
- Revert signedness type changes to "struct vmtotal"; by making
them unsigned I made the possible overflows hard to detect, and it only saved 1 bit which isn't principal, even less now that the underlying issue with the total of virtual memory has been fixed. (For the record, it will overflow with >=2T of VM total, with 32-bit ints used to keep counters in pages.) - While here, fix printing of other "struct vmtotal" members such as t_rq, t_dw, t_pw, and t_sw as they are also signed. Reviewed by: bde MFC after: 3 days
Diffstat (limited to 'release')
-rw-r--r--release/picobsd/tinyware/vm/vm.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/release/picobsd/tinyware/vm/vm.c b/release/picobsd/tinyware/vm/vm.c
index 236020b..90bb8dd 100644
--- a/release/picobsd/tinyware/vm/vm.c
+++ b/release/picobsd/tinyware/vm/vm.c
@@ -95,18 +95,14 @@ main(int argc, char *argv[])
printf(" procs kB virt mem real mem shared vm shared real free\n");
printf(" r w l s tot act tot act tot act tot act\n");
}
- printf("%2hu%2hu%2hu%2hu",v.t_rq-1,v.t_dw+v.t_pw,v.t_sl,v.t_sw);
- printf("%7lu %7lu %7lu%7lu",
- (unsigned long)pgtok(v.t_vm),
- (unsigned long)pgtok(v.t_avm),
- (unsigned long)pgtok(v.t_rm),
- (unsigned long)pgtok(v.t_arm));
- printf("%7lu%7lu%7lu%7lu%7lu\n",
- (unsigned long)pgtok(v.t_vmshr),
- (unsigned long)pgtok(v.t_avmshr),
- (unsigned long)pgtok(v.t_rmshr),
- (unsigned long)pgtok(v.t_armshr),
- (unsigned long)pgtok(v.t_free));
+ printf("%2hd%2hd%2hd%2hd",v.t_rq-1,v.t_dw+v.t_pw,v.t_sl,v.t_sw);
+ printf("%7d %7d %7d%7d",
+ pgtok(v.t_vm),pgtok(v.t_avm),
+ pgtok(v.t_rm),pgtok(v.t_arm));
+ printf("%7d%7d%7d%7d%7d\n",
+ pgtok(v.t_vmshr),pgtok(v.t_avmshr),
+ pgtok(v.t_rmshr),pgtok(v.t_armshr),
+ pgtok(v.t_free));
sleep(5);
i++;
if(i>22) i=0;
OpenPOWER on IntegriCloud