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