1<h2>task_get_exception_ports</h2>
2<hr>
3<p>
4<strong>Function</strong> - Return send rights to the target task's exception ports.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t   task_get_exception_ports</strong>
8                <strong>(task_t</strong>                                    <var>task</var>,
9                 <strong>exception_mask_t</strong>               <var>exception_types</var>,
10                 <strong>exception_mask_array_t</strong>     <var>old_exception_masks</var>,
11                 <strong>old_exception_masks</strong>        <var>old_exception_count</var>,
12                 <strong>exception_port_array_t</strong>     <var>old_exception_ports</var>,
13                 <strong>exception_behavior_array_t</strong>       <var>old_behaviors</var>,
14                 <strong>exception_flavor_array_t</strong>           <var>old_flavors</var><strong>);</strong>
15</pre>
16<h3>PARAMETERS</h3>
17<dl>
18<p>
19<dt> <var>task</var> 
20<dd>
21[in task send right]
22The task for which to return the exception ports.
23<p>
24<dt> <var>exception_types</var> 
25<dd>
26[in scalar]
27A flag word indicating the types of exceptions for which the 
28exception ports are desired:
29<dl>
30<p>
31<dt> <strong>EXC_MASK_BAD_ACCESS</strong>
32<dd>
33Could not access memory.
34<p>
35<dt> <strong>EXC_MASK_BAD_INSTRUCTION</strong>
36<dd>
37Instruction failed.  Illegal or undefined instruction or operand.
38<p>
39<dt> <strong>EXC_MASK_ARITHMETIC</strong>
40<dd>
41Arithmetic exception
42<p>
43<dt> <strong>EXC_MASK_EMULATION</strong>
44<dd>
45Emulation instruction.  Emulation support instruction
46encountered.
47<p>
48<dt> <strong>EXC_MASK_SOFTWARE</strong>
49<dd>
50Software generated exception.
51<p>
52<dt> <strong>EXC_MASK_BREAKPOINT</strong>
53<dd>
54Trace, breakpoint, etc.
55<p>
56<dt> <strong>EXC_MASK_SYSCALL</strong>
57<dd>
58System call requested.
59<p>
60<dt> <strong>EXC_MASK_MACH_SYSCALL</strong>
61<dd>
62System call with a number in the Mach call range requested.
63<p>
64<dt> <strong>EXC_MASK_RPC_ALERT	</strong>
65<dd>
66Exceptional condition encountered during execution of RPC.
67</dl>
68<p>
69<dt> <var>old_exception_masks</var> 
70<dd>
71[out array of <var>exception_mask_t</var>]
72An array, each element being a mask 
73specifying for which exception types the corresponding element of the 
74other arrays apply.
75<p>
76<dt> <var>old_exception_count</var> 
77<dd>
78[pointer to in/out scalar]
79On input, the maximum size of the array
80buffers; on output, the number of returned <exception type mask,
81exception port, behavior, flavor> sets returned.
82<p>
83<dt> <var>old_exception_ports</var> 
84<dd>
85[out array of exception send rights]
86The returned exception ports.
87<p>
88<dt> <var>old_behaviors</var> 
89<dd>
90[out array of <var>exception_behavior_t</var>]
91The type of exception message to 
92be sent.  Defined types are:
93<dl>
94<p>
95<dt> <strong>EXCEPTION_DEFAULT</strong>
96<dd>
97Send a <strong>catch_exception_raise</strong> message including the thread identity.
98<p>
99<dt> <strong>EXCEPTION_STATE</strong>
100<dd>
101Send a <strong>catch_exception_raise_state</strong> message including the 
102thread state.
103<p>
104<dt> <strong>EXCEPTION_STATE_IDENTITY</strong>
105<dd>
106Send a <strong>catch_exception_raise_state_identity</strong> message
107including the thread identity and state.
108</dl>
109<p>
110<dt> <var>old_flavors</var> 
111<dd>
112[out array of <var>thread_state_flavor_t</var>]
113The type of state to be sent with 
114the exception message.  These types are defined in <strong>&ltmach/thread_states.h&gt</strong>.
115</dl>
116<h3>DESCRIPTION</h3>
117<p>
118The <strong>task_get_exception_ports</strong> function returns send
119rights for a specified set 
120of exception ports belonging to task.  A task exception port is used when a 
121thread specific exception port returns a non-success reply. 
122The call returns a set 
123of quadruples <exception type mask, exception port, behavior, flavor> for each 
124unique set of <exception port, behavior, flavor> in effect for
125the task where the 
126exception type mask indicates for which exception types the other values apply.
127<h3>RETURN VALUES</h3>
128<p>
129Only generic errors apply.
130<h3>RELATED INFORMATION</h3>
131<p>
132Functions:
133<a href="mach_task_self.html"><strong>mach_task_self</strong></a>,
134<a href="thread_get_exception_ports.html"><strong>thread_get_exception_ports</strong></a>,
135<a href="task_set_exception_ports.html"><strong>task_set_exception_ports</strong></a>,
136<a href="task_swap_exception_ports.html"><strong>task_swap_exception_ports</strong></a>,
137<a href="thread_create.html"><strong>thread_create</strong></a>,
138<a href="thread_set_exception_ports.html"><strong>thread_set_exception_ports</strong></a>,
139<a href="TS_exception_ports.html"><strong>thread_swap_exception_ports</strong></a>,
140<a href="catch_exception_raise.html"><strong>catch_exception_raise</strong></a>.
141