freebsd proc_mem

This commit is contained in:
Doug MacEachern 2005-02-13 03:24:33 +00:00
parent 5bc64bd40a
commit 6ad0b561e7

View File

@ -473,7 +473,24 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid,
return SIGAR_OK; return SIGAR_OK;
#else #else
return SIGAR_ENOTIMPL; int status = sigar_get_pinfo(sigar, pid);
struct kinfo_proc *pinfo = sigar->pinfo;
if (status != SIGAR_OK) {
return status;
}
procmem->size = procmem->vsize =
(pinfo->kp_eproc.e_vm.vm_tsize +
pinfo->kp_eproc.e_vm.vm_dsize +
pinfo->kp_eproc.e_vm.vm_ssize) * sigar->pagesize;
procmem->resident = procmem->rss =
pinfo->kp_eproc.e_vm.vm_rssize * sigar->pagesize;
procmem->share = SIGAR_FIELD_NOTIMPL;
return SIGAR_OK;
#endif #endif
} }