From d3acf798d5279c6c39ed61d25cf8b68d53364f2b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 5 Apr 2010 16:30:15 -0700 Subject: [PATCH] (SIGAR-188) implement mem actual free/used on OpenBSD and NetBSD --- src/os/darwin/darwin_sigar.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 59314dba..6dda00de 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -489,6 +489,13 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem) return status; } mem->free = vmstat.free; + kern = vmstat.inactive; +# if defined(__OpenBSD__) + kern += vmstat.vnodepages + vmstat.vtextpages; +# elif defined(__NetBSD__) + kern += vmstat.filepages + vmstat.execpages; +# endif + kern *= sigar->pagesize; #endif mem->used = mem->total - mem->free;