- else
- result = KERN_INVALID_ARGUMENT;
- }
- else
- result = KERN_INVALID_ARGUMENT;
-
- /*
- * Delete our send rights to the task port.
- */
- (void)mach_port_deallocate(get_task_ipcspace(ux_handler_self), task_name);
-
- return (result);
-}
-
-kern_return_t
-catch_exception_raise_state(
- __unused mach_port_t exception_port,
- __unused exception_type_t exception,
- __unused const exception_data_t code,
- __unused mach_msg_type_number_t codeCnt,
- __unused int *flavor,
- __unused const thread_state_t old_state,
- __unused mach_msg_type_number_t old_stateCnt,
- __unused thread_state_t new_state,
- __unused mach_msg_type_number_t *new_stateCnt)
-{
- return(KERN_INVALID_ARGUMENT);
-}
-
-kern_return_t
-catch_mach_exception_raise_state(
- __unused mach_port_t exception_port,
- __unused exception_type_t exception,
- __unused const mach_exception_data_t code,
- __unused mach_msg_type_number_t codeCnt,
- __unused int *flavor,
- __unused const thread_state_t old_state,
- __unused mach_msg_type_number_t old_stateCnt,
- __unused thread_state_t new_state,
- __unused mach_msg_type_number_t *new_stateCnt)
-{
- return(KERN_INVALID_ARGUMENT);
-}
-
-kern_return_t
-catch_exception_raise_state_identity(
- __unused mach_port_t exception_port,
- __unused mach_port_t thread,
- __unused mach_port_t task,
- __unused exception_type_t exception,
- __unused exception_data_t code,
- __unused mach_msg_type_number_t codeCnt,
- __unused int *flavor,
- __unused thread_state_t old_state,
- __unused mach_msg_type_number_t old_stateCnt,
- __unused thread_state_t new_state,
- __unused mach_msg_type_number_t *new_stateCnt)
-{
- return(KERN_INVALID_ARGUMENT);
-}
-
-kern_return_t
-catch_mach_exception_raise_state_identity(
- __unused mach_port_t exception_port,
- __unused mach_port_t thread,
- __unused mach_port_t task,
- __unused exception_type_t exception,
- __unused mach_exception_data_t code,
- __unused mach_msg_type_number_t codeCnt,
- __unused int *flavor,
- __unused thread_state_t old_state,
- __unused mach_msg_type_number_t old_stateCnt,
- __unused thread_state_t new_state,
- __unused mach_msg_type_number_t *new_stateCnt)
-{
- return(KERN_INVALID_ARGUMENT);
-}
-
-
-/*
- * ux_exception translates a mach exception, code and subcode to
- * a signal and u.u_code. Calls machine_exception (machine dependent)
- * to attempt translation first.
- */
-
-static
-void ux_exception(
- int exception,
- mach_exception_code_t code,
- mach_exception_subcode_t subcode,
- int *ux_signal,
- mach_exception_code_t *ux_code)
-{
- /*
- * Try machine-dependent translation first.
- */
- if (machine_exception(exception, code, subcode, ux_signal, ux_code))
- return;
-
- switch(exception) {
-
- case EXC_BAD_ACCESS:
- if (code == KERN_INVALID_ADDRESS)
- *ux_signal = SIGSEGV;
- else
- *ux_signal = SIGBUS;
- break;