#include <mach/task_access_server.h>
mach/task_access_server.h
macro_task_access_server_
#define _task_access_server_
functioncheck_task_access
extern MIG_SERVER_ROUTINE kern_return_t check_task_access( mach_port_t task_access_port, int32_t calling_pid, uint32_t calling_gid, int32_t target_pid, audit_token_t caller_cred /* serveraudittoken */ )
Verify task_for_pid access for the given pid
Access granted by return value (success/failure)
functionfind_code_signature
extern MIG_SERVER_ROUTINE kern_return_t find_code_signature( mach_port_t task_access_port, int32_t new_pid )
Search for a code signature for unsigned executables
functioncheck_task_access_with_flavor
extern MIG_SERVER_ROUTINE kern_return_t check_task_access_with_flavor( mach_port_t task_access_port, int32_t calling_pid, uint32_t calling_gid, int32_t target_pid, mach_task_flavor_t flavor, audit_token_t caller_cred /* serveraudittoken */ )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/task_access.defs, bsd/kern/kern_proc.c
Routine of the task_access MIG subsystem (subsystem id 27000), implemented by the user-space task access server (taskgated). The kernel calls it (bsd/kern/kern_proc.c) on the host task-access port during task_for_pid and related operations to ask whether the process identified by calling_pid/calling_gid may obtain the port of the given flavor (mach_task_flavor_t, e.g. TASK_FLAVOR_CONTROL, TASK_FLAVOR_READ) for target_pid; access is granted by a KERN_SUCCESS return. The server-side prototype additionally receives the caller's audit token (ServerAuditToken); the task_access.h declaration is the kernel-side send stub without it.
functiontask_access_server
extern boolean_t task_access_server( mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/task_access.defs
MIG-generated demultiplexer for the task_access subsystem (osfmk/mach/task_access.defs). If the request message at InHeadP belongs to the subsystem, calls the matching handler (check_task_access, find_code_signature, check_task_access_with_flavor), formats the reply message at OutHeadP, and returns TRUE; returns FALSE, with a MIG_BAD_ID error reply, for messages that do not belong to the subsystem.
functiontask_access_server_routine
extern mig_routine_t task_access_server_routine(mach_msg_header_t *InHeadP)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/task_access.defs
Returns the MIG dispatch function for the task_access subsystem request whose msgh_id is found in InHeadP, or a null pointer if the message is not a request of the subsystem. Alternative to the combined demultiplexer for servers that look up and invoke the handler themselves.
structtask_access_subsystem
Description of this subsystem, for use in direct RPC
| mig_server_routine_t | server | Server routine |
| mach_msg_id_t | start | Min routine number |
| mach_msg_id_t | end | Max routine number + 1 |
| unsigned int | maxsize | Max msg size |
| vm_address_t | reserved | Reserved |
| struct routine_descriptor[3] | routine |
variabletask_access_subsystem
extern const struct task_access_subsystem { mig_server_routine_t server; /* Server routine */ mach_msg_id_t start; /* Min routine number */ mach_msg_id_t end; /* Max routine number + 1 */ unsigned int maxsize; /* Max msg size */ vm_address_t reserved; /* Reserved */ struct routine_descriptor /* Array of routine descriptors */ routine[3]; } task_access_subsystem