#include <mach/task_access.h>

mach/task_access.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, sys/cdefs.h
3 macros · 3 functions

macro_task_access_user_

#define _task_access_user_ 

macrotask_access_MSG_COUNT

#define task_access_MSG_COUNT 3

functioncheck_task_access

extern kern_return_t check_task_access(
	mach_port_t task_access_port,
	int32_t calling_pid,
	uint32_t calling_gid,
	int32_t target_pid
)
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 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 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
)
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.

macrosubsystem_to_name_map_task_access

#define subsystem_to_name_map_task_access { "check_task_access", 27000 },
    { "find_code_signature", 27001 },
    { "check_task_access_with_flavor", 27002 }