From f9291a4e85aad3532ad157fa5d6660c0b145ae13 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 16 Jun 2005 22:21:24 +0000 Subject: [PATCH] proc_mem fixes --- src/os/darwin/darwin_sigar.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index a5ca6fb9..2bb89492 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -704,7 +704,11 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, return errno; } - status = task_info(task, TASK_BASIC_INFO, (task_info_t)&info, &type); + count = TASK_BASIC_INFO_COUNT; + status = task_info(task, TASK_BASIC_INFO, (task_info_t)&info, &count); + if (status != KERN_SUCCESS) { + return errno; + } vsize = info.virtual_size; resident = info.resident_size; @@ -721,7 +725,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, count = VM_REGION_BASIC_INFO_COUNT_64; if (vm_region_64(task, &address, &size, VM_REGION_BASIC_INFO, (vm_region_info_t)&basic, - &type, &object_name)) + &count, &object_name)) { break; } @@ -729,7 +733,7 @@ int sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid, count = VM_REGION_TOP_INFO_COUNT; if (vm_region_64(task, &address, &size, VM_REGION_TOP_INFO, (vm_region_info_t)&top, - &type, &object_name)) + &count, &object_name)) { break; }