1 <h2>task_set_exception_ports
</h2>
4 <strong>Function
</strong> - Set target task's exception ports.
7 <strong>kern_return_t task_set_exception_ports
</strong>
8 <strong>(task_t
</strong> <var>task
</var>,
9 <strong>exception_mask_t
</strong> <var>exception_types
</var>,
10 <strong>mach_port_t
</strong> <var>exception_port
</var>,
11 <strong>exception_behavior_t
</strong> <var>behavior
</var>,
12 <strong>thread_state_flavor_t
</strong> <var>flavor
</var><strong>);
</strong>
20 The task for which to set the ports.
22 <dt> <var>exception_types
</var>
25 A flag word indicating the types of exceptions for which the
26 exception port applies:
29 <dt> <strong>EXC_MASK_BAD_ACCESS
</strong>
31 Could not access memory.
33 <dt> <strong>EXC_MASK_BAD_INSTRUCTION
</strong>
35 Instruction failed. Illegal or undefined instruction or operand.
37 <dt> <strong>EXC_MASK_ARITHMETIC
</strong>
41 <dt> <strong>EXC_MASK_EMULATION
</strong>
43 Emulation instruction. Emulation support instruction
46 <dt> <strong>EXC_MASK_SOFTWARE
</strong>
48 Software generated exception.
50 <dt> <strong>EXC_MASK_BREAKPOINT
</strong>
52 Trace, breakpoint, etc.
54 <dt> <strong>EXC_MASK_SYSCALL
</strong>
56 System call requested.
58 <dt> <strong>EXC_MASK_MACH_SYSCALL
</strong>
60 System call with a number in the Mach call range requested.
62 <dt> <strong>EXC_MASK_RPC_ALERT
</strong>
64 Exceptional condition encountered during execution of RPC.
67 <dt> <var>exception_port
</var>
69 [in exception send right]
70 The exception port for all selected exception
73 <dt> <var>behavior
</var>
76 The type of exception message to be sent. Defined types are:
79 <dt> <strong>EXCEPTION_DEFAULT
</strong>
81 Send a
<strong>catch_exception_raise
</strong> message including the thread
84 <dt> <strong>EXCEPTION_STATE
</strong>
86 Send a
<strong>catch_exception_raise_state
</strong> message including the
89 <dt> <strong>EXCEPTION_STATE_PROTECTED
</strong>
91 Send a
<strong>catch_exception_raise_state
</strong> message including the
92 thread state. Mark the exception port (and associated
93 exceptions) as protected.
95 <dt> <strong>EXCEPTION_STATE_IDENTITY
</strong>
97 Send a
<strong>catch_exception_raise_state_identity
</strong> message
98 including the thread identity and state.
100 <dt> <strong>EXCEPTION_STATE_IDENTITY_PROTECTED
</strong>
102 Send a
<strong>catch_exception_raise_state_identity
</strong> message
103 including the thread identity and state. Mark the exception port
104 (and associated exceptions) as protected.
107 <dt> <var>flavor
</var>
110 The type of state to be sent with the exception message.
111 These types are defined in
<strong><mach/thread_states.h>
</strong>.
115 The
<strong>task_set_exception_ports
</strong> function sets a specified
116 set of exception ports belonging to
<var>task
</var>. A task exception port
117 is used when a thread specific exception port returns a non-success reply.
120 If the value of the
<strong>EXC_MACH_SYSCALL
</strong> exception class exception port is
121 the host name port, Mach kernel traps are executed by the kernel as expected;
122 any other value causes the attempted execution of these system call numbers to
123 be considered an exception.
124 <h3>RETURN VALUES
</h3>
126 Only generic errors apply.
127 <h3>RELATED INFORMATION
</h3>
130 <a href=
"mach_task_self.html"><strong>mach_task_self
</strong></a>,
131 <a href=
"task_get_exception_ports.html"><strong>task_get_exception_ports
</strong></a>,
132 <a href=
"task_swap_exception_ports.html"><strong>task_swap_exception_ports
</strong></a>,
133 <a href=
"thread_set_exception_ports.html"><strong>thread_set_exception_ports
</strong></a>,
134 <a href=
"thread_create.html"><strong>thread_create
</strong></a>,
135 <a href=
"thread_get_exception_ports.html"><strong>thread_get_exception_ports
</strong></a>,
136 <a href=
"TS_exception_ports.html"><strong>thread_swap_exception_ports
</strong></a>,
137 <a href=
"catch_exception_raise.html"><strong>catch_exception_raise
</strong></a>,
138 <a href=
"thread_abort.html"><strong>thread_abort
</strong></a>.