]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/sched_get_priority_max.2
sched_setattr.2: tfix
[thirdparty/man-pages.git] / man2 / sched_get_priority_max.2
CommitLineData
fea681da
MK
1.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
2.\"
1dd72f9c 3.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
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.
8.\"
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.
13.\"
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.
18.\"
19.\" You should have received a copy of the GNU General Public
c715f741
MK
20.\" License along with this manual; if not, see
21.\" <http://www.gnu.org/licenses/>.
6a8d8745 22.\" %%%LICENSE_END
fea681da
MK
23.\"
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>
27.\" revision
28.\"
4b8c67d9 29.TH SCHED_GET_PRIORITY_MAX 2 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da
MK
30.SH NAME
31sched_get_priority_max, sched_get_priority_min \- get static priority range
32.SH SYNOPSIS
33.B #include <sched.h>
68e4db0a 34.PP
ca313a68 35.BI "int sched_get_priority_max(int " policy );
68e4db0a 36.PP
ca313a68 37.BI "int sched_get_priority_min(int " policy );
fea681da 38.SH DESCRIPTION
e511ffb6 39.BR sched_get_priority_max ()
fea681da 40returns the maximum priority value that can be used with the
c6fa0841
MK
41scheduling algorithm identified by
42.IR policy .
e511ffb6 43.BR sched_get_priority_min ()
fea681da 44returns the minimum priority value that can be used with the
c6fa0841
MK
45scheduling algorithm identified by
46.IR policy .
47Supported
48.I policy
fea681da 49values are
5917ad3d
MK
50.BR SCHED_FIFO ,
51.BR SCHED_RR ,
52.BR SCHED_OTHER ,
4f56bc07 53.BR SCHED_BATCH ,
ce97aba3 54.BR SCHED_IDLE ,
c13182ef 55and
ce97aba3 56.BR SCHED_DEADLINE .
92c37d8c 57Further details about these policies can be found in
a0102365 58.BR sched (7).
efeece04 59.PP
fea681da 60Processes with numerically higher priority values are scheduled before
c13182ef
MK
61processes with numerically lower priority values.
62Thus, the value
60a90ecd
MK
63returned by
64.BR sched_get_priority_max ()
65will be greater than the
66value returned by
67.BR sched_get_priority_min ().
efeece04 68.PP
72a80539 69Linux allows the static priority range 1 to 99 for the
c6fa0841
MK
70.B SCHED_FIFO
71and
72.B SCHED_RR
72a80539 73policies, and the priority 0 for the remaining policies.
92c37d8c 74Scheduling priority ranges for the various policies
fea681da 75are not alterable.
efeece04 76.PP
fea681da
MK
77The range of scheduling priorities may vary on other POSIX systems,
78thus it is a good idea for portable applications to use a virtual
79priority range and map it to the interval given by
60a90ecd
MK
80.BR sched_get_priority_max ()
81and
30ea59e7 82.BR sched_get_priority_min
5f2ccde3
MK
83POSIX.1 requires
84.\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
85a spread of at least 32 between the maximum and the minimum values for
c6fa0841
MK
86.B SCHED_FIFO
87and
88.BR SCHED_RR .
efeece04 89.PP
fea681da 90POSIX systems on which
e511ffb6 91.BR sched_get_priority_max ()
fea681da 92and
e511ffb6 93.BR sched_get_priority_min ()
fea681da 94are available define
f25eaea8 95.B _POSIX_PRIORITY_SCHEDULING
c6fa0841
MK
96in
97.IR <unistd.h> .
47297adb 98.SH RETURN VALUE
fea681da 99On success,
e511ffb6 100.BR sched_get_priority_max ()
fea681da 101and
e511ffb6 102.BR sched_get_priority_min ()
fea681da
MK
103return the maximum/minimum priority value for the named scheduling
104policy.
92c37d8c 105On error, \-1 is returned, and
fea681da
MK
106.I errno
107is set appropriately.
108.SH ERRORS
109.TP
110.B EINVAL
c6fa0841
MK
111The argument
112.I policy
113does not identify a defined scheduling policy.
47297adb 114.SH CONFORMING TO
5f2ccde3 115POSIX.1-2001, POSIX.1-2008.
47297adb 116.SH SEE ALSO
ca8a0bd2
MK
117.ad l
118.nh
fea681da
MK
119.BR sched_getaffinity (2),
120.BR sched_getparam (2),
121.BR sched_getscheduler (2),
122.BR sched_setaffinity (2),
123.BR sched_setparam (2),
a0102365
MK
124.BR sched_setscheduler (2),
125.BR sched (7)