xref: /xnu-10002.61.3/osfmk/man/thread_get_state.html (revision 0f4c859e951fba394238ab619495c4e1d54d0f34)
1*0f4c859eSApple OSS Distributions<h2>thread_get_state</h2>
2*0f4c859eSApple OSS Distributions<hr>
3*0f4c859eSApple OSS Distributions<p>
4*0f4c859eSApple OSS Distributions<strong>Function</strong> - Return the execution state for a thread.
5*0f4c859eSApple OSS Distributions<h3>SYNOPSIS</h3>
6*0f4c859eSApple OSS Distributions<pre>
7*0f4c859eSApple OSS Distributions<strong>kern_return_t   thread_get_state</strong>
8*0f4c859eSApple OSS Distributions                <strong>(thread_act_t</strong>                     <var>target_thread</var>,
9*0f4c859eSApple OSS Distributions                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,
10*0f4c859eSApple OSS Distributions                 <strong>thread_state_t</strong>                       <var>old_state</var>,
11*0f4c859eSApple OSS Distributions                 <strong>mach_msg_type_number_t</strong>         <var>old_state_count</var><strong>);</strong>
12*0f4c859eSApple OSS Distributions</pre>
13*0f4c859eSApple OSS Distributions<h3>PARAMETERS</h3>
14*0f4c859eSApple OSS Distributions<dl>
15*0f4c859eSApple OSS Distributions<p>
16*0f4c859eSApple OSS Distributions<dt> <var>target_thread</var>
17*0f4c859eSApple OSS Distributions<dd>
18*0f4c859eSApple OSS Distributions[in thread send right]
19*0f4c859eSApple OSS DistributionsThe thread for which the execution state is to be
20*0f4c859eSApple OSS Distributionsreturned.  The calling thread cannot specify itself.
21*0f4c859eSApple OSS Distributions<p>
22*0f4c859eSApple OSS Distributions<dt> <var>flavor</var>
23*0f4c859eSApple OSS Distributions<dd>
24*0f4c859eSApple OSS Distributions[in scalar]
25*0f4c859eSApple OSS DistributionsThe type of execution state to be returned.  Valid values
26*0f4c859eSApple OSS Distributionscorrespond to supported machined architectures.
27*0f4c859eSApple OSS Distributions<p>
28*0f4c859eSApple OSS Distributions<dt> <var>old_state</var>
29*0f4c859eSApple OSS Distributions<dd>
30*0f4c859eSApple OSS Distributions[out structure]
31*0f4c859eSApple OSS DistributionsState information for the specified thread.
32*0f4c859eSApple OSS Distributions<p>
33*0f4c859eSApple OSS Distributions<dt> <var>old_state_count</var>
34*0f4c859eSApple OSS Distributions<dd>
35*0f4c859eSApple OSS Distributions[in/out scalar]
36*0f4c859eSApple OSS DistributionsOn input, the maximum size of the buffer; on output, the
37*0f4c859eSApple OSS Distributionssize returned (in natural-sized units).
38*0f4c859eSApple OSS Distributions</dl>
39*0f4c859eSApple OSS Distributions<h3>DESCRIPTION</h3>
40*0f4c859eSApple OSS Distributions<p>
41*0f4c859eSApple OSS DistributionsThe <strong>thread_get_state</strong> function returns the execution
42*0f4c859eSApple OSS Distributionsstate (for example, the
43*0f4c859eSApple OSS Distributionsmachine registers) for <var>target_thread</var>. flavor specifies the type
44*0f4c859eSApple OSS Distributionsof state information
45*0f4c859eSApple OSS Distributionsreturned.
46*0f4c859eSApple OSS Distributions<p>
47*0f4c859eSApple OSS DistributionsThe format of the data returned is machine specific; it is defined in
48*0f4c859eSApple OSS Distributions\*L<mach/thread_status.h>\*O.
49*0f4c859eSApple OSS Distributions<h3>RETURN VALUES</h3>
50*0f4c859eSApple OSS Distributions<p>
51*0f4c859eSApple OSS DistributionsOnly generic errors apply.
52*0f4c859eSApple OSS Distributions<h3>RELATED INFORMATION</h3>
53*0f4c859eSApple OSS Distributions<p>
54*0f4c859eSApple OSS DistributionsFunctions:
55*0f4c859eSApple OSS Distributions<a href="task_info.html"><strong>task_info</strong></a>,
56*0f4c859eSApple OSS Distributions<a href="thread_info.html"><strong>thread_info</strong></a>,
57*0f4c859eSApple OSS Distributions<a href="thread_set_state.html"><strong>thread_set_state</strong></a>.
58