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