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
98 .Bd -literal -offset indent
100 int sched_priority; /* scheduling priority */
105 .Fn sched_getscheduler
106 system call returns the scheduling policy of the process specified
110 If a process specified by
112 exists and if the calling process has permission,
113 the scheduling parameters for the process whose process ID is equal to
117 In this implementation, the policy of when a process can obtain the
118 scheduling parameters of another process are detailed in
120 as a read-style operation.
124 is zero, the scheduling parameters for the calling process will be
126 In this implementation, the
127 .Fa sched_getscheduler
128 system call will fail if
136 will be set to the corresponding value:
139 The system is not configured to support this functionality.
141 The requesting process doesn not have permission as detailed in
144 No process can be found corresponding to that specified by
149 argument is invalid, or one or more of the parameters contained in
151 is outside the valid range for the specified scheduling policy.
154 .Xr sched_get_priority_max 2 ,
155 .Xr sched_get_priority_min 2 ,
156 .Xr sched_getparam 2 ,
157 .Xr sched_rr_get_interval 2 ,
158 .Xr sched_setparam 2 ,
162 .Fn sched_setscheduler
164 .Fn sched_getscheduler
165 system calls conform to