mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Use longs vs. ints in calculating the amount of swap. This fixed getting
negative swap values on an Alpha with 2GB swap. I should probably use `long long' for large swap x86 machines. (anybody want to help test?)
This commit is contained in:
parent
db9c952504
commit
c9e00131ca
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=46605
5 changed files with 63 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
--- bsd/kernel.cc.orig Mon Jul 5 21:09:30 1999
|
||||
+++ bsd/kernel.cc Sat Jun 10 14:25:05 2000
|
||||
+++ bsd/kernel.cc Tue Aug 21 10:49:26 2001
|
||||
@@ -284,7 +284,12 @@
|
||||
while (nlp && nlp->n_name) {
|
||||
if ((nlp->n_type == 0) || (nlp->n_value == 0))
|
||||
|
@ -13,6 +13,15 @@
|
|||
nlp++;
|
||||
}
|
||||
#ifdef HAVE_DEVSTAT
|
||||
@@ -457,7 +462,7 @@
|
||||
//
|
||||
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int *totalp, int *freep) {
|
||||
+BSDGetSwapCtlInfo(long *totalp, long *freep) {
|
||||
int totalinuse, totalsize;
|
||||
int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0);
|
||||
struct swapent *swapiter;
|
||||
@@ -792,25 +797,25 @@
|
||||
OpenKDIfNeeded();
|
||||
nintr = (nlst[EINTRCNT_SYM_INDEX].n_value -
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
--- bsd/kernel.h.orig Fri May 29 14:21:36 1998
|
||||
+++ bsd/kernel.h Sat Jun 10 14:18:22 2000
|
||||
+++ bsd/kernel.h Tue Aug 21 10:50:17 2001
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
#ifdef HAVE_SWAPCTL
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int* total, int* free);
|
||||
+BSDGetSwapCtlInfo(long* total, long* free);
|
||||
#endif
|
||||
|
||||
int
|
||||
@@ -67,7 +67,11 @@
|
||||
#endif
|
||||
|
||||
|
|
24
sysutils/xosview/files/patch-swapinternal.cc
Normal file
24
sysutils/xosview/files/patch-swapinternal.cc
Normal file
|
@ -0,0 +1,24 @@
|
|||
--- bsd/swapinternal.cc.orig Tue Nov 16 23:16:20 1999
|
||||
+++ bsd/swapinternal.cc Tue Aug 21 11:27:26 2001
|
||||
@@ -437,16 +437,17 @@
|
||||
#endif /* XOSVIEW_FREEBSD */
|
||||
|
||||
void
|
||||
-BSDGetSwapInfo(int* total, int* free)
|
||||
+BSDGetSwapInfo(long* total, long* free)
|
||||
{
|
||||
- int i, avail, npfree, used=0, xsize, xfree;
|
||||
+ int i, npfree, xsize, xfree;
|
||||
+ long avail, used=0;
|
||||
|
||||
fetchswap();
|
||||
#ifdef USE_KVM_GETSWAPINFO
|
||||
avail = used = 0;
|
||||
if (kvnsw == 0) {
|
||||
- avail += pagesize * kvmsw[0].ksw_total;
|
||||
- used += pagesize * kvmsw[0].ksw_used;
|
||||
+ avail += pagesize * (long)kvmsw[0].ksw_total;
|
||||
+ used += pagesize * (long)kvmsw[0].ksw_used;
|
||||
}
|
||||
*total = avail;
|
||||
*free = avail - used;
|
12
sysutils/xosview/files/patch-swapinternal.h
Normal file
12
sysutils/xosview/files/patch-swapinternal.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- bsd/swapinternal.h.orig Wed Feb 11 21:04:07 1998
|
||||
+++ bsd/swapinternal.h Tue Aug 21 10:51:00 2001
|
||||
@@ -12,7 +12,7 @@
|
||||
BSDInitSwapInfo();
|
||||
|
||||
void
|
||||
-BSDGetSwapInfo(int* total, int* free);
|
||||
+BSDGetSwapInfo(long* total, long* free);
|
||||
|
||||
void
|
||||
-BSDGetSwapCtlInfo(int* total, int* free);
|
||||
+BSDGetSwapCtlInfo(long* total, long* free);
|
7
sysutils/xosview/files/patch-swapmeter.cc
Normal file
7
sysutils/xosview/files/patch-swapmeter.cc
Normal file
|
@ -0,0 +1,7 @@
|
|||
--- bsd/swapmeter.cc.orig Tue Aug 21 10:52:35 2001
|
||||
+++ bsd/swapmeter.cc Tue Aug 21 10:53:02 2001
|
||||
@@ -76,3 +76,3 @@
|
||||
void SwapMeter::getswapinfo( void ){
|
||||
- int total_int, free_int;
|
||||
+ long total_int, free_int;
|
||||
|
Loading…
Add table
Reference in a new issue