1 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
25 .\" First version written
26 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
28 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
30 .TH SCHED_SETPARAM 2 2013-02-12 "Linux" "Linux Programmer's Manual"
32 sched_setparam, sched_getparam \- set and get scheduling parameters
37 .BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param );
39 .BI "int sched_getparam(pid_t " pid ", struct sched_param *" param );
41 \fBstruct sched_param {
43 int \fIsched_priority\fB;
49 sets the scheduling parameters associated with the scheduling policy
50 for the process identified by \fIpid\fP.
51 If \fIpid\fP is zero, then
52 the parameters of the calling process are set.
54 the argument \fIparam\fP depends on the scheduling
55 policy of the process identified by
58 .BR sched_setscheduler (2)
59 for a description of the scheduling policies supported under Linux.
62 retrieves the scheduling parameters for the
63 process identified by \fIpid\fP.
64 If \fIpid\fP is zero, then the parameters
65 of the calling process are retrieved.
68 checks the validity of \fIparam\fP for the scheduling policy of the
70 The value \fIparam\->sched_priority\fP must lie within the
72 .BR sched_get_priority_min (2)
74 .BR sched_get_priority_max (2).
76 For a discussion of the privileges and resource limits related to
77 scheduling priority and policy, see
78 .BR sched_setscheduler (2).
80 POSIX systems on which
85 .B _POSIX_PRIORITY_SCHEDULING
93 On error, \-1 is returned, and
99 The argument \fIparam\fP does not make sense for the current
103 The calling process does not have appropriate privileges
104 (Linux: does not have the
109 The process whose ID is \fIpid\fP could not be found.
114 Scheduling parameters are in fact per-thread
117 .BR sched_setscheduler (2).
123 .BR sched_get_priority_max (2),
124 .BR sched_get_priority_min (2),
125 .BR sched_getaffinity (2),
126 .BR sched_getscheduler (2),
127 .BR sched_setaffinity (2),
128 .BR sched_setscheduler (2),
132 .I Programming for the real world \- POSIX.4
133 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0.