filter out system procs

This commit is contained in:
Doug MacEachern 2005-03-20 19:10:14 +00:00
parent 0347b1043d
commit 8e63b5ea78
1 changed files with 4 additions and 1 deletions

View File

@ -1595,12 +1595,15 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol,
return ENOENT;
}
pinfo = kvm_getprocs(sigar->kmem, KERN_PROC_ALL, 0, &nentries);
pinfo = kvm_getprocs(sigar->kmem, KERN_PROC_PROC, 0, &nentries);
if (!pinfo) {
return errno;
}
for (i=0; i<nentries; i++) {
if (pinfo[i].KI_FLAG & P_SYSTEM) {
continue;
}
if (pinfo[i].ki_fd) {
struct filedesc pfd;
struct file **ofiles, ofile;