1<h2>task_policy</h2> 2<hr> 3<p> 4<strong>Function</strong> - Set target task's default scheduling policy state. 5<h3>SYNOPSIS</h3> 6<pre> 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> 14</pre> 15<h3>PARAMETERS</h3> 16<dl> 17<dt> <var>task</var> 18<dd> 19[in task send right] 20The port for the task whose scheduling attributes 21are to be set. 22<dt> <var>policy</var> 23<dd> 24[in scalar] 25Default 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). 27<dt> <var>base</var> 28<dd> 29[pointer to in structure] 30Base 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> 33<dd> 34[in scalar] 35The size of the buffer (in natural-sized units). 36<dt> <var>set_limit</var> 37<dd> 38[in scalar] 39True if the scheduling limits for the task should be restricted 40to allow no more service than specified by <var>base</var>. 41<dt> <var>change_threads</var> 42<dd> 43[in scalar] 44True if the attributes (and limits, if <var>set_limit</var> is true) of 45existing threads within the task should also be changed. 46</dl> 47<h3>DESCRIPTION</h3> 48<p> 49The <strong>task_policy</strong> function sets the default scheduling 50attributes for <var>task</var>. These 51attributes are used when creating new threads. Changing the default attributes 52for 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 54scheduling attributes that exceed the thread's limits. 55<h3>RETURN VALUES</h3> 56<dl> 57<dt> <strong>KERN_INVALID_POLICY</strong> 58<dd> 59The processor set does not currently enable <var>policy</var>. 60<dt> <strong>KERN_POLICY_LIMIT</strong> 61<dd> 62The specified scheduling attributes exceeds the thread's limits. 63</dl> 64<h3>RELATED INFORMATION</h3> 65<p> 66Functions: 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>. 71<p> 72Data Structures: 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>. 76