1 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
6 .\" First version written
7 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
9 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
11 .TH SCHED_SETPARAM 2 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
13 sched_setparam, sched_getparam \- set and get scheduling parameters
16 .RI ( libc ", " \-lc )
21 .BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param );
22 .BI "int sched_getparam(pid_t " pid ", struct sched_param *" param );
24 \fBstruct sched_param {
26 int \fIsched_priority\fB;
32 sets the scheduling parameters associated with the scheduling policy
33 for the thread whose thread ID is specified in \fIpid\fP.
34 If \fIpid\fP is zero, then
35 the parameters of the calling thread are set.
37 the argument \fIparam\fP depends on the scheduling
38 policy of the thread identified by
42 for a description of the scheduling policies supported under Linux.
45 retrieves the scheduling parameters for the
46 thread identified by \fIpid\fP.
47 If \fIpid\fP is zero, then the parameters
48 of the calling thread are retrieved.
51 checks the validity of \fIparam\fP for the scheduling policy of the
53 The value \fIparam\->sched_priority\fP must lie within the
55 .BR sched_get_priority_min (2)
57 .BR sched_get_priority_max (2).
59 For a discussion of the privileges and resource limits related to
60 scheduling priority and policy, see
63 POSIX systems on which
68 .B _POSIX_PRIORITY_SCHEDULING
76 On error, \-1 is returned, and
78 is set to indicate the error.
89 .RB ( sched_setparam ())
90 The argument \fIparam\fP does not make sense for the current
94 .RB ( sched_setparam ())
95 The caller does not have appropriate privileges
96 (Linux: does not have the
101 The thread whose ID is \fIpid\fP could not be found.
103 POSIX.1-2001, POSIX.1-2008.
110 .BR sched_get_priority_max (2),
111 .BR sched_get_priority_min (2),
112 .BR sched_getaffinity (2),
113 .BR sched_getscheduler (2),
114 .BR sched_setaffinity (2),
115 .BR sched_setattr (2),
116 .BR sched_setscheduler (2),
118 .BR capabilities (7),