4 <strong>Function
</strong> - Set target task's default scheduling policy state.
7 <strong>kern_return_t task_policy
</strong>
8 <strong>(task_t
</strong> <var>task
</var>,
9 <strong>policy_t
</strong> <var>policy
</var>,
10 <strong>policy_base_t
</strong> <var>base
</var>,
11 <strong>base
</strong> <var>base_count
</var>,
12 <strong>boolean_t
</strong> <var>set_limit
</var>,
13 <strong>boolean_t
</strong> <var>change_threads
</var><strong>);
</strong>
20 The port for the task whose scheduling attributes
22 <dt> <var>policy
</var>
25 Default policy. The values currently defined are
<strong>POLICY_TIMESHARE
</strong>,
26 <strong>POLICY_RR
</strong> (round robin) and
<strong>POLICY_FIFO
</strong> (firstin, first-out).
29 [pointer to in structure]
30 Base scheduling policy data,
<strong>policy_fifo_base
</strong>,
31 <strong>policy_rr_base
</strong> or
<strong>policy_timeshare_base
</strong>.
32 <dt> <var>base_count
</var>
35 The size of the buffer (in natural-sized units).
36 <dt> <var>set_limit
</var>
39 True if the scheduling limits for the task should be restricted
40 to allow no more service than specified by
<var>base
</var>.
41 <dt> <var>change_threads
</var>
44 True if the attributes (and limits, if
<var>set_limit
</var> is true) of
45 existing threads within the task should also be changed.
49 The
<strong>task_policy
</strong> function sets the default scheduling
50 attributes for
<var>task
</var>. These
51 attributes are used when creating new threads. Changing the default attributes
52 for a task does not affect the attributes of the contained threads unless
53 <var>change_threads
</var> is
<strong>TRUE
</strong>. At no time will a thread ever have
54 scheduling attributes that exceed the thread's limits.
55 <h3>RETURN VALUES
</h3>
57 <dt> <strong>KERN_INVALID_POLICY
</strong>
59 The processor set does not currently enable
<var>policy
</var>.
60 <dt> <strong>KERN_POLICY_LIMIT
</strong>
62 The specified scheduling attributes exceeds the thread's limits.
64 <h3>RELATED INFORMATION
</h3>
67 <a href=
"thread_policy.html"><strong>thread_policy
</strong></a>,
68 <a href=
"thread_set_policy.html"><strong>thread_set_policy
</strong></a>,
69 <a href=
"task_set_policy.html"><strong>task_set_policy
</strong></a>,
70 <a href=
"P_set_policy_control.html"><strong>processor_set_policy_control
</strong></a>.
73 <a href=
"policy_fifo_info.html"><strong>policy_fifo_info
</strong></a>,
74 <a href=
"policy_rr_info.html"><strong>policy_rr_info
</strong></a>,
75 <a href=
"policy_timeshare_info.html"><strong>policy_timeshare_info
</strong></a>.