OpenBSD sigar_swap_get impl
This commit is contained in:
parent
34c19b60b9
commit
06059b41fe
|
@ -574,8 +574,17 @@ int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap)
|
||||||
else {
|
else {
|
||||||
swap->page_in = swap->page_out = -1;
|
swap->page_in = swap->page_out = -1;
|
||||||
}
|
}
|
||||||
#else
|
#elif defined(__OpenBSD__)
|
||||||
/*XXX OpenBSD*/
|
struct uvmexp vmstat;
|
||||||
|
|
||||||
|
if ((status = sigar_vmstat(sigar, &vmstat)) != SIGAR_OK) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
swap->total = vmstat.swpages * sigar->pagesize;
|
||||||
|
swap->used = vmstat.swpginuse * sigar->pagesize;
|
||||||
|
swap->free = swap->total - swap->used;
|
||||||
|
swap->page_in = vmstat.pageins;
|
||||||
|
swap->page_out = vmstat.pdpageouts;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
|
|
Loading…
Reference in New Issue