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