xref: /xnu-10063.121.3/osfmk/man/thread_info.html (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions<h2>thread_info</h2>
2*2c2f96dcSApple OSS Distributions<hr>
3*2c2f96dcSApple OSS Distributions<p>
4*2c2f96dcSApple OSS Distributions<strong>Function</strong> - Return information about a thread.
5*2c2f96dcSApple OSS Distributions<h3>SYNOPSIS</h3>
6*2c2f96dcSApple OSS Distributions<pre>
7*2c2f96dcSApple OSS Distributions<strong>kern_return_t   thread_info</strong>
8*2c2f96dcSApple OSS Distributions                <strong>(thread_act_t</strong>                     <var>target_thread</var>,
9*2c2f96dcSApple OSS Distributions                 <strong>thread_flavor_t</strong>                         <var>flavor</var>,
10*2c2f96dcSApple OSS Distributions                 <strong>thread_info_t</strong>                      <var>thread_info</var>,
11*2c2f96dcSApple OSS Distributions                 <strong>mach_msg_type_number_t</strong>       <var>thread_info_count</var><strong>);</strong>
12*2c2f96dcSApple OSS Distributions</pre>
13*2c2f96dcSApple OSS Distributions<h3>PARAMETERS</h3>
14*2c2f96dcSApple OSS Distributions<dl>
15*2c2f96dcSApple OSS Distributions<p>
16*2c2f96dcSApple OSS Distributions<dt> <var>target_thread</var>
17*2c2f96dcSApple OSS Distributions<dd>
18*2c2f96dcSApple OSS Distributions[in thread send right]
19*2c2f96dcSApple OSS DistributionsThe thread for which the information is to be
20*2c2f96dcSApple OSS Distributionsreturned.
21*2c2f96dcSApple OSS Distributions<p>
22*2c2f96dcSApple OSS Distributions<dt> <var>flavor</var>
23*2c2f96dcSApple OSS Distributions<dd>
24*2c2f96dcSApple OSS Distributions[in scalar]
25*2c2f96dcSApple OSS DistributionsThe type of information to be returned.  Valid values are:
26*2c2f96dcSApple OSS Distributions<dl>
27*2c2f96dcSApple OSS Distributions<p>
28*2c2f96dcSApple OSS Distributions<dt> <strong>THREAD_BASIC_INFO</strong>
29*2c2f96dcSApple OSS Distributions<dd>
30*2c2f96dcSApple OSS DistributionsReturns basic information about the thread, such as the
31*2c2f96dcSApple OSS Distributionsthread's run state and suspend count.  The returned structure is
32*2c2f96dcSApple OSS Distributions<strong>thread_basic_info</strong>.
33*2c2f96dcSApple OSS Distributions<p>
34*2c2f96dcSApple OSS Distributions<dt> <strong>THREAD_SCHED_FIFO_INFO</strong>
35*2c2f96dcSApple OSS Distributions<dd>
36*2c2f96dcSApple OSS DistributionsReturns FIFO scheduling policy information about the thread.
37*2c2f96dcSApple OSS DistributionsThe returned structure is <strong>policy_fifo_info</strong>.
38*2c2f96dcSApple OSS Distributions<p>
39*2c2f96dcSApple OSS Distributions<dt> <strong>THREAD_SCHED_RR_INFO</strong>
40*2c2f96dcSApple OSS Distributions<dd>
41*2c2f96dcSApple OSS DistributionsReturns round-robin scheduling policy information about the
42*2c2f96dcSApple OSS Distributionsthread.  The returned structure is <strong>policy_rr_info</strong>.
43*2c2f96dcSApple OSS Distributions<p>
44*2c2f96dcSApple OSS Distributions<dt> <strong>THREAD_SCHED_TIMESHARE_INFO</strong>
45*2c2f96dcSApple OSS Distributions<dd>
46*2c2f96dcSApple OSS DistributionsReturns timeshare scheduling policy information about the
47*2c2f96dcSApple OSS Distributionsthread.  The returned structure is <strong>policy_timeshare_info</strong>.
48*2c2f96dcSApple OSS Distributions</dl>
49*2c2f96dcSApple OSS Distributions<p>
50*2c2f96dcSApple OSS Distributions<dt> <var>thread_info</var>
51*2c2f96dcSApple OSS Distributions<dd>
52*2c2f96dcSApple OSS Distributions[out structure]
53*2c2f96dcSApple OSS DistributionsInformation about the specified thread.
54*2c2f96dcSApple OSS Distributions<p>
55*2c2f96dcSApple OSS Distributions<dt> <var>thread_info_count</var>
56*2c2f96dcSApple OSS Distributions<dd>
57*2c2f96dcSApple OSS Distributions[in/out scalar]
58*2c2f96dcSApple OSS DistributionsOn input, the maximum size of the buffer; on output, the
59*2c2f96dcSApple OSS Distributionssize returned (in natural-sized units).
60*2c2f96dcSApple OSS Distributions</dl>
61*2c2f96dcSApple OSS Distributions<h3>DESCRIPTION</h3>
62*2c2f96dcSApple OSS Distributions<p>
63*2c2f96dcSApple OSS DistributionsThe <strong>thread_info</strong> function returns an information structure
64*2c2f96dcSApple OSS Distributionsof type <var>flavor</var>.
65*2c2f96dcSApple OSS Distributions<h3>NOTES</h3>
66*2c2f96dcSApple OSS Distributions<p>
67*2c2f96dcSApple OSS DistributionsAt any given time, a thread has only one scheduling policy in
68*2c2f96dcSApple OSS Distributionseffect for it.  Thus,
69*2c2f96dcSApple OSS Distributionsonly one of the scheduling information structures will be valid,
70*2c2f96dcSApple OSS Distributionsthat so indicated
71*2c2f96dcSApple OSS Distributionsby the policy value returned by <strong>THREAD_BASIC_INFO</strong>.
72*2c2f96dcSApple OSS Distributions<h3>RETURN VALUES</h3>
73*2c2f96dcSApple OSS Distributions<p>
74*2c2f96dcSApple OSS DistributionsOnly generic errors apply.
75*2c2f96dcSApple OSS Distributions<h3>RELATED INFORMATION</h3>
76*2c2f96dcSApple OSS Distributions<p>
77*2c2f96dcSApple OSS DistributionsFunctions:
78*2c2f96dcSApple OSS Distributions<a href="task_info.html"><strong>task_info</strong></a>,
79*2c2f96dcSApple OSS Distributions<a href="task_threads.html"><strong>task_threads</strong></a>,
80*2c2f96dcSApple OSS Distributions<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,
81*2c2f96dcSApple OSS Distributions<a href="thread_set_special_port.html"><strong>thread_set_special_port</strong></a>,
82*2c2f96dcSApple OSS Distributions<a href="thread_set_state.html"><strong>thread_set_state</strong></a>.
83*2c2f96dcSApple OSS Distributions<p>
84*2c2f96dcSApple OSS DistributionsData Structures:
85*2c2f96dcSApple OSS Distributions<a href="thread_basic_info.html"><strong>thread_basic_info</strong></a>,
86*2c2f96dcSApple OSS Distributions<a href="policy_timeshare_info.html"><strong>policy_timeshare_info</strong></a>,
87*2c2f96dcSApple OSS Distributions<a href="policy_fifo_info.html"><strong>policy_fifo_info</strong></a>,
88*2c2f96dcSApple OSS Distributions<a href="policy_rr_info.html"><strong>policy_rr_info</strong></a>.
89