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