|
|
@@ -137,7 +137,7 @@ mono_process_list (int *size)
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
-static char*
|
|
|
+static G_GNUC_UNUSED char*
|
|
|
get_pid_status_item_buf (int pid, const char *item, char *rbuf, int blen, MonoProcessError *error)
|
|
|
{
|
|
|
char buf [256];
|
|
|
@@ -271,27 +271,24 @@ get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
|
|
|
#if defined(__APPLE__)
|
|
|
double process_user_time = 0, process_system_time = 0;//, process_percent = 0;
|
|
|
task_t task;
|
|
|
+ struct task_basic_info t_info;
|
|
|
+ mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
|
|
|
+ thread_array_t th_array;
|
|
|
+ size_t i;
|
|
|
|
|
|
if (task_for_pid(mach_task_self(), pid, &task) != KERN_SUCCESS)
|
|
|
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
|
|
|
-
|
|
|
- struct task_basic_info t_info;
|
|
|
- mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
|
|
|
|
|
|
if (task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
|
|
|
mach_port_deallocate (mach_task_self (), task);
|
|
|
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
|
|
|
}
|
|
|
|
|
|
- thread_array_t th_array;
|
|
|
-
|
|
|
if (task_threads(task, &th_array, &th_count) != KERN_SUCCESS) {
|
|
|
mach_port_deallocate (mach_task_self (), task);
|
|
|
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
|
|
|
}
|
|
|
|
|
|
- size_t i;
|
|
|
-
|
|
|
for (i = 0; i < th_count; i++) {
|
|
|
double thread_user_time, thread_system_time;//, thread_percent;
|
|
|
|
|
|
@@ -407,11 +404,11 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
|
|
|
|
|
|
gint64 ret;
|
|
|
task_t task;
|
|
|
- if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
|
|
|
- RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
|
|
|
-
|
|
|
struct task_basic_info t_info;
|
|
|
mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
|
|
|
+
|
|
|
+ if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
|
|
|
+ RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
|
|
|
|
|
|
if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
|
|
|
mach_port_deallocate (mach_task_self (), task);
|