Author: Michael Tokarev <mjt@tls.msk.ru>
Description: vmstat shouldn't scale si/so just like it doesn't scale
bi/bo.
Use strtoull insteadof strtoul for some counters.
Bug-Debian: http://bugs.debian.org/558361
Bug-Debian: http://bugs.debian.org/558134
--- a/proc/sysinfo.c
+++ b/proc/sysinfo.c
@@ -606,7 +606,7 @@
     );
     head = tail+1;
     if(!found) goto nextline;
-    *(found->slot) = strtoul(head,&tail,10);
+    *(found->slot) = (unsigned long)strtoull(head,&tail,10);
 nextline:
     tail = strchr(head, '\n');
     if(!tail) break;
--- a/vmstat.c
+++ b/vmstat.c
@@ -209,8 +209,8 @@
 	 unitConvert(kb_swap_used), unitConvert(kb_main_free),
 	 unitConvert(a_option?kb_inactive:kb_main_buffers),
 	 unitConvert(a_option?kb_active:kb_main_cached),
-	 (unsigned)( (*pswpin  * kb_per_page * hz + divo2) / Div ),
-	 (unsigned)( (*pswpout * kb_per_page * hz + divo2) / Div ),
+	 (unsigned)( (*pswpin  * unitConvert(kb_per_page) * hz + divo2) / Div ),
+	 (unsigned)( (*pswpout * unitConvert(kb_per_page) * hz + divo2) / Div ),
 	 (unsigned)( (*pgpgin                * hz + divo2) / Div ),
 	 (unsigned)( (*pgpgout               * hz + divo2) / Div ),
 	 (unsigned)( (*intr                  * hz + divo2) / Div ),
@@ -258,8 +258,8 @@
 	   unitConvert(kb_swap_used),unitConvert(kb_main_free),
 	   unitConvert(a_option?kb_inactive:kb_main_buffers),
 	   unitConvert(a_option?kb_active:kb_main_cached),
-	   (unsigned)( ( (pswpin [tog] - pswpin [!tog])*kb_per_page+sleep_half )/sleep_time ), /*si*/
-	   (unsigned)( ( (pswpout[tog] - pswpout[!tog])*kb_per_page+sleep_half )/sleep_time ), /*so*/
+	   (unsigned)( ( (pswpin [tog] - pswpin [!tog])*unitConvert(kb_per_page)+sleep_half )/sleep_time ), /*si*/
+	   (unsigned)( ( (pswpout[tog] - pswpout[!tog])*unitConvert(kb_per_page)+sleep_half )/sleep_time ), /*so*/
 	   (unsigned)( (  pgpgin [tog] - pgpgin [!tog]             +sleep_half )/sleep_time ), /*bi*/
 	   (unsigned)( (  pgpgout[tog] - pgpgout[!tog]             +sleep_half )/sleep_time ), /*bo*/
 	   (unsigned)( (  intr   [tog] - intr   [!tog]             +sleep_half )/sleep_time ), /*in*/
