diff options
Diffstat (limited to 'system_cmds/vm_purgeable_stat.tproj')
-rw-r--r-- | system_cmds/vm_purgeable_stat.tproj/entitlements.plist | 2 | ||||
-rw-r--r-- | system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/system_cmds/vm_purgeable_stat.tproj/entitlements.plist b/system_cmds/vm_purgeable_stat.tproj/entitlements.plist index 2ee8d1e..b21dbd8 100644 --- a/system_cmds/vm_purgeable_stat.tproj/entitlements.plist +++ b/system_cmds/vm_purgeable_stat.tproj/entitlements.plist @@ -2,7 +2,7 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>com.apple.system-task-ports.inspect</key> + <key>task_for_pid-allow</key> <true/> </dict> </plist> diff --git a/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c b/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c index 330704d..e0a0011 100644 --- a/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c +++ b/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c @@ -22,11 +22,11 @@ * @APPLE_LICENSE_HEADER_END@ */ -#include <System/sys/proc.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <unistd.h> +typedef char *kobject_description_t[512]; #include <mach/mach.h> #include <mach/mach_types.h> #include <mach/task.h> @@ -88,7 +88,7 @@ int get_task_from_pid(int pid, task_t *task) fprintf(stderr, "%s\n", PRIV_ERR_MSG); return -1; } - kr = task_inspect_for_pid(mach_task_self(), pid, task); + kr = task_for_pid(mach_task_self(), pid, task); if (kr != KERN_SUCCESS) { fprintf(stderr, "Failed to get task port for pid: %d\n", pid); return -1; @@ -128,9 +128,9 @@ int get_system_tasks(task_array_t *tasks, mach_msg_type_number_t *count) vm_deallocate(mach_task_self(), (vm_address_t)psets, (vm_size_t)psetCount * sizeof(mach_port_t)); /* convert the processor-set-priv to a list of tasks for the processor set */ - ret = processor_set_tasks_with_flavor(pset_priv, TASK_FLAVOR_INSPECT, tasks, count); + ret = processor_set_tasks(pset_priv, tasks, count); if (ret != KERN_SUCCESS) { - fprintf(stderr, "processor_set_tasks_with_flavor() failed: %s\n", mach_error_string(ret)); + fprintf(stderr, "processor_set_tasks() failed: %s\n", mach_error_string(ret)); return -1; } mach_port_deallocate(mach_task_self(), pset_priv); |