2 .\" Copyright (c) 1998 HD Associates, Inc.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .Dt SCHED_SETSCHEDULER 2
30 .Nm sched_setscheduler ,
31 .Nm sched_getscheduler
32 .Nd set/get scheduling policy and scheduler parameters
38 .Fn sched_setscheduler "pid_t pid" "int policy" "const struct sched_param *param"
40 .Fn sched_getscheduler "pid_t pid"
43 .Fn sched_setscheduler
44 system call sets the scheduling policy and scheduling parameters
45 of the process specified by
49 and the parameters specified in the
51 structure pointed to by
58 structure must be any integer within the inclusive priority range for
59 the scheduling policy specified by
62 In this implementation, if the value of
64 is negative the system call will fail.
66 If a process specified by
68 exists and if the calling process has permission, the scheduling
69 policy and scheduling parameters will be set for the process
70 whose process ID is equal to
75 is zero, the scheduling policy and scheduling
76 parameters are set for the calling process.
78 In this implementation, the policy of when a process can affect
79 the scheduling parameters of another process is specified in
81 as a write-style operation.
83 The scheduling policies are in
85 .Bl -tag -width [SCHED_OTHER]
87 First-in-first-out fixed priority scheduling with no round robin scheduling;
89 The standard time sharing scheduler;
91 Round-robin scheduling across same priority processes.
96 structure is defined in
99 .Bd -literal -offset indent
101 int sched_priority; /* scheduling priority */
106 .Fn sched_getscheduler
107 system call returns the scheduling policy of the process specified
111 If a process specified by
113 exists and if the calling process has permission,
114 the scheduling parameters for the process whose process ID is equal to
118 In this implementation, the policy of when a process can obtain the
119 scheduling parameters of another process are detailed in
121 as a read-style operation.
125 is zero, the scheduling parameters for the calling process will be
127 In this implementation, the
128 .Fa sched_getscheduler
129 system call will fail if
137 will be set to the corresponding value:
140 The system is not configured to support this functionality.
142 The requesting process doesn not have permission as detailed in
145 No process can be found corresponding to that specified by
150 argument is invalid, or one or more of the parameters contained in
152 is outside the valid range for the specified scheduling policy.
155 .Xr sched_getparam 2 ,
156 .Xr sched_get_priority_max 2 ,
157 .Xr sched_get_priority_min 2 ,
158 .Xr sched_rr_get_interval 2 ,
159 .Xr sched_setparam 2 ,
163 .Fn sched_setscheduler
165 .Fn sched_getscheduler
166 system calls conform to