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