#include <mach/task_access_server.h>

mach/task_access_server.h Kernel.framework

includes: Kernel/string.h, Kernel/mach/ndr.h, Kernel/mach/boolean.h, Kernel/mach/kern_return.h, Kernel/mach/notify.h, mach/mach_types.h, mach/message.h, Kernel/mach/mig_errors.h, mach/port.h, Availability.h, Kernel/mach/std_types.h, Kernel/mach/mig.h, Kernel/mach/mig.h, mach/mach_types.h
5 functions · 1 macro · 1 struct · 1 variable

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)
MIG routine from mach/task_access.defs

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
MIG routine from mach/task_access.defs

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 */
)
MIG routine from mach/task_access.defs
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
size 152, align 8
mig_server_routine_tserverServer routine
mach_msg_id_tstartMin routine number
mach_msg_id_tendMax routine number + 1
unsigned intmaxsizeMax msg size
vm_address_treservedReserved
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