filter out system procs
This commit is contained in:
parent
0347b1043d
commit
8e63b5ea78
|
@ -1595,12 +1595,15 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol,
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
pinfo = kvm_getprocs(sigar->kmem, KERN_PROC_ALL, 0, &nentries);
|
pinfo = kvm_getprocs(sigar->kmem, KERN_PROC_PROC, 0, &nentries);
|
||||||
if (!pinfo) {
|
if (!pinfo) {
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<nentries; i++) {
|
for (i=0; i<nentries; i++) {
|
||||||
|
if (pinfo[i].KI_FLAG & P_SYSTEM) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (pinfo[i].ki_fd) {
|
if (pinfo[i].ki_fd) {
|
||||||
struct filedesc pfd;
|
struct filedesc pfd;
|
||||||
struct file **ofiles, ofile;
|
struct file **ofiles, ofile;
|
||||||
|
|
Loading…
Reference in New Issue