1 .\" Copyright (c) 1998 HD Associates, Inc.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .Dt SCHED_SETSCHEDULER 2
29 .Nm sched_setscheduler ,
30 .Nm sched_getscheduler
31 .Nd set/get scheduling policy and scheduler parameters
37 .Fn sched_setscheduler "pid_t pid" "int policy" "const struct sched_param *param"
39 .Fn sched_getscheduler "pid_t pid"
42 .Fn sched_setscheduler
43 system call sets the scheduling policy and scheduling parameters
44 of the process specified by
48 and the parameters specified in the
50 structure pointed to by
57 structure must be any integer within the inclusive priority range for
58 the scheduling policy specified by
61 In this implementation, if the value of
63 is negative the system call will fail.
65 If a process specified by
67 exists and if the calling process has permission, the scheduling
68 policy and scheduling parameters will be set for the process
69 whose process ID is equal to
74 is zero, the scheduling policy and scheduling
75 parameters are set for the calling process.
77 In this implementation, the policy of when a process can affect
78 the scheduling parameters of another process is specified in
80 as a write-style operation.
82 The scheduling policies are in
84 .Bl -tag -width [SCHED_OTHER]
86 First-in-first-out fixed priority scheduling with no round robin scheduling;
88 The standard time sharing scheduler;
90 Round-robin scheduling across same priority processes.
95 structure is defined in
97 .Bd -literal -offset indent
99 int sched_priority; /* scheduling priority */
104 .Fn sched_getscheduler
105 system call returns the scheduling policy of the process specified
109 If a process specified by
111 exists and if the calling process has permission,
112 the scheduling parameters for the process whose process ID is equal to
116 In this implementation, the policy of when a process can obtain the
117 scheduling parameters of another process are detailed in
119 as a read-style operation.
123 is zero, the scheduling parameters for the calling process will be
125 In this implementation, the
126 .Fa sched_getscheduler
127 system call will fail if
135 will be set to the corresponding value:
138 The system is not configured to support this functionality.
140 The requesting process doesn not have permission as detailed in
143 No process can be found corresponding to that specified by
148 argument is invalid, or one or more of the parameters contained in
150 is outside the valid range for the specified scheduling policy.
153 .Xr sched_get_priority_max 2 ,
154 .Xr sched_get_priority_min 2 ,
155 .Xr sched_getparam 2 ,
156 .Xr sched_rr_get_interval 2 ,
157 .Xr sched_setparam 2 ,
161 .Fn sched_setscheduler
163 .Fn sched_getscheduler
164 system calls conform to