#include <mach/mach_exc_server.h>

mach/mach_exc_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
7 structs · 6 typedefs · 5 functions · 3 macros · 2 unions · 1 variable

macro_mach_exc_server_

#define _mach_exc_server_ 

macromach_exc_MSG_COUNT

#define mach_exc_MSG_COUNT 6

functioncatch_mach_exception_raise

extern MIG_SERVER_ROUTINE kern_return_t catch_mach_exception_raise(
	mach_port_t exception_port,
	mach_port_t thread,
	mach_port_t task,
	exception_type_t exception,
	mach_exception_data_t code,
	mach_msg_type_number_t codeCnt
)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/mach_exc.defs
Server-interface routine of the mach_exc MIG subsystem (subsystem id 2405); invoked by mach_exc_server for exception ports registered with EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES. Identical in contract to catch_exception_raise except that the exception codes are 64-bit (mach_exception_data_t). Returning KERN_SUCCESS tells the kernel the exception was handled and the thread may continue.

functioncatch_mach_exception_raise_state

extern MIG_SERVER_ROUTINE kern_return_t catch_mach_exception_raise_state(
	mach_port_t exception_port,
	exception_type_t exception,
	const mach_exception_data_t code,
	mach_msg_type_number_t codeCnt,
	int *flavor,
	const thread_state_t old_state,
	mach_msg_type_number_t old_stateCnt,
	thread_state_t new_state,
	mach_msg_type_number_t *new_stateCnt
)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/mach_exc.defs
Server-interface routine of the mach_exc MIG subsystem for exception ports registered with EXCEPTION_STATE | MACH_EXCEPTION_CODES. Receives the exception type, 64-bit code words, and the victim thread's state; returns replacement state in new_state/new_stateCnt, which the kernel loads into the thread on KERN_SUCCESS. No thread or task ports are conveyed.

functioncatch_mach_exception_raise_state_identity

extern MIG_SERVER_ROUTINE kern_return_t catch_mach_exception_raise_state_identity(
	mach_port_t exception_port,
	mach_port_t thread,
	mach_port_t task,
	exception_type_t exception,
	mach_exception_data_t code,
	mach_msg_type_number_t codeCnt,
	int *flavor,
	thread_state_t old_state,
	mach_msg_type_number_t old_stateCnt,
	thread_state_t new_state,
	mach_msg_type_number_t *new_stateCnt
)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/mach_exc.defs
Server-interface routine of the mach_exc MIG subsystem for exception ports registered with EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES. Receives the victim thread and task ports, the exception type with 64-bit code words, and the thread state; returns replacement state in new_state/new_stateCnt.

functionmach_exc_server

extern boolean_t mach_exc_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/mach_exc.defs
MIG-generated demultiplexer for the mach_exc subsystem (osfmk/mach/mach_exc.defs). If the request message at InHeadP belongs to the subsystem, calls the matching handler (catch_mach_exception_raise, catch_mach_exception_raise_state, catch_mach_exception_raise_state_identity), 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. Used by handlers registered with the MACH_EXCEPTION_CODES behavior modifier, which carries 64-bit exception codes; exc_server handles the legacy 32-bit form.

functionmach_exc_server_routine

extern mig_routine_t mach_exc_server_routine(mach_msg_header_t *InHeadP)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/mach/mach_exc.defs
Returns the MIG dispatch function for the mach_exc 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.

structcatch_mach_exc_subsystem

Description of this subsystem, for use in direct RPC
size 272, 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[6]routine

variablecatch_mach_exc_subsystem

extern const struct catch_mach_exc_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[6]; } catch_mach_exc_subsystem

struct__Request__mach_exception_raise_t

size 100, align 4
mach_msg_header_tHead
mach_msg_body_tmsgh_bodystart of the kernel processed data
mach_msg_port_descriptor_tthread
mach_msg_port_descriptor_ttask
NDR_record_tNDRend of the kernel processed data
exception_type_texception
mach_msg_type_number_tcodeCnt
int64_t[2]code

typedef__Request__mach_exception_raise_t

typedef struct __Request__mach_exception_raise_t __Request__mach_exception_raise_t;

typedef__Request__mach_exception_raise_state_t

typedef struct __Request__mach_exception_raise_state_t __Request__mach_exception_raise_state_t;

struct__Request__mach_exception_raise_state_identity_t

size 5292, align 4
mach_msg_header_tHead
mach_msg_body_tmsgh_bodystart of the kernel processed data
mach_msg_port_descriptor_tthread
mach_msg_port_descriptor_ttask
NDR_record_tNDRend of the kernel processed data
exception_type_texception
mach_msg_type_number_tcodeCnt
int64_t[2]code
intflavor
mach_msg_type_number_told_stateCnt
natural_t[1296]old_state

typedef__Request__mach_exception_raise_state_identity_t

typedef struct __Request__mach_exception_raise_state_identity_t __Request__mach_exception_raise_state_identity_t;

union__RequestUnion__catch_mach_exc_subsystem

size 5292, align 4
__Request__mach_exception_raise_tRequest_mach_exception_raise
__Request__mach_exception_raise_state_tRequest_mach_exception_raise_state
__Request__mach_exception_raise_state_identity_tRequest_mach_exception_raise_state_identity

typedef__Reply__mach_exception_raise_t

typedef struct __Reply__mach_exception_raise_t __Reply__mach_exception_raise_t;

struct__Reply__mach_exception_raise_state_t

size 5236, align 4
mach_msg_header_tHead
NDR_record_tNDR
kern_return_tRetCode
intflavor
mach_msg_type_number_tnew_stateCnt
natural_t[1296]new_state

typedef__Reply__mach_exception_raise_state_t

typedef struct __Reply__mach_exception_raise_state_t __Reply__mach_exception_raise_state_t;

typedef__Reply__mach_exception_raise_state_identity_t

typedef struct __Reply__mach_exception_raise_state_identity_t __Reply__mach_exception_raise_state_identity_t;

union__ReplyUnion__catch_mach_exc_subsystem

size 5236, align 4
__Reply__mach_exception_raise_tReply_mach_exception_raise
__Reply__mach_exception_raise_state_tReply_mach_exception_raise_state
__Reply__mach_exception_raise_state_identity_tReply_mach_exception_raise_state_identity

macrosubsystem_to_name_map_mach_exc

#define subsystem_to_name_map_mach_exc { "mach_exception_raise", 2405 },
    { "mach_exception_raise_state", 2406 },
    { "mach_exception_raise_state_identity", 2407 }