#include <mach/mach_exc_server.h>
mach/mach_exc_server.h
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
| 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[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_subsystemstruct__Request__mach_exception_raise_t
| mach_msg_header_t | Head | |
| mach_msg_body_t | msgh_body | start of the kernel processed data |
| mach_msg_port_descriptor_t | thread | |
| mach_msg_port_descriptor_t | task | |
| NDR_record_t | NDR | end of the kernel processed data |
| exception_type_t | exception | |
| mach_msg_type_number_t | codeCnt | |
| int64_t[2] | code |
typedef__Request__mach_exception_raise_t
typedef struct __Request__mach_exception_raise_t __Request__mach_exception_raise_t;
struct__Request__mach_exception_raise_state_t
| mach_msg_header_t | Head | |
| NDR_record_t | NDR | |
| exception_type_t | exception | |
| mach_msg_type_number_t | codeCnt | |
| int64_t[2] | code | |
| int | flavor | |
| mach_msg_type_number_t | old_stateCnt | |
| natural_t[1296] | old_state |
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
| mach_msg_header_t | Head | |
| mach_msg_body_t | msgh_body | start of the kernel processed data |
| mach_msg_port_descriptor_t | thread | |
| mach_msg_port_descriptor_t | task | |
| NDR_record_t | NDR | end of the kernel processed data |
| exception_type_t | exception | |
| mach_msg_type_number_t | codeCnt | |
| int64_t[2] | code | |
| int | flavor | |
| mach_msg_type_number_t | old_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
| __Request__mach_exception_raise_t | Request_mach_exception_raise | |
| __Request__mach_exception_raise_state_t | Request_mach_exception_raise_state | |
| __Request__mach_exception_raise_state_identity_t | Request_mach_exception_raise_state_identity |
struct__Reply__mach_exception_raise_t
| mach_msg_header_t | Head | |
| NDR_record_t | NDR | |
| kern_return_t | RetCode |
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
| mach_msg_header_t | Head | |
| NDR_record_t | NDR | |
| kern_return_t | RetCode | |
| int | flavor | |
| mach_msg_type_number_t | new_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;
struct__Reply__mach_exception_raise_state_identity_t
| mach_msg_header_t | Head | |
| NDR_record_t | NDR | |
| kern_return_t | RetCode | |
| int | flavor | |
| mach_msg_type_number_t | new_stateCnt | |
| natural_t[1296] | new_state |
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
| __Reply__mach_exception_raise_t | Reply_mach_exception_raise | |
| __Reply__mach_exception_raise_state_t | Reply_mach_exception_raise_state | |
| __Reply__mach_exception_raise_state_identity_t | Reply_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 }