aboutsummaryrefslogtreecommitdiffstats
path: root/system_cmds/vm_purgeable_stat.tproj
diff options
context:
space:
mode:
Diffstat (limited to 'system_cmds/vm_purgeable_stat.tproj')
-rw-r--r--system_cmds/vm_purgeable_stat.tproj/entitlements.plist2
-rw-r--r--system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/system_cmds/vm_purgeable_stat.tproj/entitlements.plist b/system_cmds/vm_purgeable_stat.tproj/entitlements.plist
index b21dbd8..2ee8d1e 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>task_for_pid-allow</key>
+ <key>com.apple.system-task-ports.inspect</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 bfef539..330704d 100644
--- a/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c
+++ b/system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat.c
@@ -22,6 +22,7 @@
* @APPLE_LICENSE_HEADER_END@
*/
+#include <System/sys/proc.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -87,7 +88,7 @@ int get_task_from_pid(int pid, task_t *task)
fprintf(stderr, "%s\n", PRIV_ERR_MSG);
return -1;
}
- kr = task_for_pid(mach_task_self(), pid, task);
+ kr = task_inspect_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;
@@ -127,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(pset_priv, tasks, count);
+ ret = processor_set_tasks_with_flavor(pset_priv, TASK_FLAVOR_INSPECT, tasks, count);
if (ret != KERN_SUCCESS) {
- fprintf(stderr, "processor_set_tasks() failed: %s\n", mach_error_string(ret));
+ fprintf(stderr, "processor_set_tasks_with_flavor() failed: %s\n", mach_error_string(ret));
return -1;
}
mach_port_deallocate(mach_task_self(), pset_priv);