summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-14 20:29:08 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-14 20:29:08 +0000
commit66a70fdfc51fd0949c2a20a4ba1f7a46335600a9 (patch)
treed47ebc9f9261f3262a7060cd827d13546bf254ed /src
parent7a090a7350c7fc1f21bbde1b74ce2fa0fcb43f22 (diff)
downloadzabbix-66a70fdfc51fd0949c2a20a4ba1f7a46335600a9.tar.gz
zabbix-66a70fdfc51fd0949c2a20a4ba1f7a46335600a9.tar.xz
zabbix-66a70fdfc51fd0949c2a20a4ba1f7a46335600a9.zip
- support for swap sizes >2Gb under Solaris. Thanks to Franky
Van Liedekerke. (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@1028 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_agent/sysinfo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/zabbix_agent/sysinfo.c b/src/zabbix_agent/sysinfo.c
index 183ed266..00dd0352 100644
--- a/src/zabbix_agent/sysinfo.c
+++ b/src/zabbix_agent/sysinfo.c
@@ -592,10 +592,12 @@ crc_buf2(p, clen, cval)
/* Solaris. */
#ifndef HAVE_SYSINFO_FREESWAP
#ifdef HAVE_SYS_SWAP_SWAPTABLE
-void get_swapinfo(int *total, int *fr)
+void get_swapinfo(double *total, double *fr)
{
register int cnt, i, page_size;
- register int t, f;
+/* Support for >2Gb */
+/* register int t, f;*/
+ double t, f;
struct swaptable *swt;
struct swapent *ste;
static char path[256];
@@ -1907,11 +1909,11 @@ double SWAPFREE(void)
/* Solaris */
#else
#ifdef HAVE_SYS_SWAP_SWAPTABLE
- int swaptotal,swapfree;
+ double swaptotal,swapfree;
get_swapinfo(&swaptotal,&swapfree);
- return (double)swapfree;
+ return swapfree;
#else
return FAIL;
#endif
@@ -1956,11 +1958,11 @@ double SWAPTOTAL(void)
/* Solaris */
#else
#ifdef HAVE_SYS_SWAP_SWAPTABLE
- int swaptotal,swapfree;
+ double swaptotal,swapfree;
get_swapinfo(&swaptotal,&swapfree);
- return (double)swaptotal;
+ return swaptotal;
#else
return FAIL;
#endif