From 6f86a076236b395b2ea8f8352decd3c6288e7a4a Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 13 Feb 2005 05:05:21 +0000 Subject: [PATCH] filter out system processes and threads from proc_list --- src/os/darwin/darwin_sigar.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index a1c24a44..e42bff73 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -429,13 +429,15 @@ int sigar_proc_list_get(sigar_t *sigar, return SIGAR_EPERM_KMEM; } - proc = kvm_getprocs(sigar->kmem, KERN_PROC_ALL, 0, &num); + proc = kvm_getprocs(sigar->kmem, KERN_PROC_PROC, 0, &num); - proclist->number = 0; - proclist->size = num; - proclist->data = malloc(sizeof(*(proclist->data)) * num); + sigar_proc_list_create(proclist); for (i=0; idata[proclist->number++] = proc[i].KI_PID; } #endif