From 935ac34dc19cf4aa56b7324847aa03fa3382073c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 4 Sep 2005 04:38:21 +0000 Subject: [PATCH] swap_get impl --- src/os/netware/netware_sigar.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/os/netware/netware_sigar.c b/src/os/netware/netware_sigar.c index 5665d4b7..c4937747 100644 --- a/src/os/netware/netware_sigar.c +++ b/src/os/netware/netware_sigar.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -97,9 +98,15 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap) { - swap->total = -1; - swap->used = -1; - swap->free = -1; + struct vmemory_info info; + + if (netware_vmem_info(&info) != 0) { + return errno; + } + + swap->used = info.SwapPageCount * PAGESIZE; + swap->free = info.SwapFreeCount * PAGESIZE; + swap->total = swap->used + swap->free; return SIGAR_OK; }