(SIGAR-188) implement mem actual free/used on OpenBSD and NetBSD

This commit is contained in:
Doug MacEachern 2010-04-05 16:30:15 -07:00
parent 1ba3abd3ab
commit d3acf798d5
1 changed files with 7 additions and 0 deletions

View File

@ -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;