]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/sched_get_priority_max.2
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man2 / sched_get_priority_max.2
CommitLineData
fea681da
MK
1.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
2.\"
e4a74ca8 3.\" SPDX-License-Identifier: GPL-2.0-or-later
fea681da
MK
4.\"
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>
8.\" revision
9.\"
4c1c5274 10.TH sched_get_priority_max 2 (date) "Linux man-pages (unreleased)"
fea681da
MK
11.SH NAME
12sched_get_priority_max, sched_get_priority_min \- get static priority range
96e2debd
AC
13.SH LIBRARY
14Standard C library
8fc3b2cf 15.RI ( libc ", " \-lc )
fea681da 16.SH SYNOPSIS
15d65653 17.nf
fea681da 18.B #include <sched.h>
c6d039a3 19.P
ca313a68 20.BI "int sched_get_priority_max(int " policy );
ca313a68 21.BI "int sched_get_priority_min(int " policy );
15d65653 22.fi
fea681da 23.SH DESCRIPTION
e511ffb6 24.BR sched_get_priority_max ()
fea681da 25returns the maximum priority value that can be used with the
c6fa0841
MK
26scheduling algorithm identified by
27.IR policy .
e511ffb6 28.BR sched_get_priority_min ()
fea681da 29returns the minimum priority value that can be used with the
c6fa0841
MK
30scheduling algorithm identified by
31.IR policy .
32Supported
33.I policy
fea681da 34values are
5917ad3d
MK
35.BR SCHED_FIFO ,
36.BR SCHED_RR ,
37.BR SCHED_OTHER ,
4f56bc07 38.BR SCHED_BATCH ,
ce97aba3 39.BR SCHED_IDLE ,
c13182ef 40and
ce97aba3 41.BR SCHED_DEADLINE .
92c37d8c 42Further details about these policies can be found in
a0102365 43.BR sched (7).
c6d039a3 44.P
fea681da 45Processes with numerically higher priority values are scheduled before
c13182ef
MK
46processes with numerically lower priority values.
47Thus, the value
60a90ecd
MK
48returned by
49.BR sched_get_priority_max ()
50will be greater than the
51value returned by
52.BR sched_get_priority_min ().
c6d039a3 53.P
72a80539 54Linux allows the static priority range 1 to 99 for the
c6fa0841
MK
55.B SCHED_FIFO
56and
57.B SCHED_RR
72a80539 58policies, and the priority 0 for the remaining policies.
92c37d8c 59Scheduling priority ranges for the various policies
fea681da 60are not alterable.
c6d039a3 61.P
fea681da
MK
62The range of scheduling priorities may vary on other POSIX systems,
63thus it is a good idea for portable applications to use a virtual
64priority range and map it to the interval given by
60a90ecd
MK
65.BR sched_get_priority_max ()
66and
4cc91169 67.BR sched_get_priority_min ()
5f2ccde3
MK
68POSIX.1 requires
69.\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
70a spread of at least 32 between the maximum and the minimum values for
c6fa0841
MK
71.B SCHED_FIFO
72and
73.BR SCHED_RR .
c6d039a3 74.P
fea681da 75POSIX systems on which
e511ffb6 76.BR sched_get_priority_max ()
fea681da 77and
e511ffb6 78.BR sched_get_priority_min ()
fea681da 79are available define
f25eaea8 80.B _POSIX_PRIORITY_SCHEDULING
c6fa0841
MK
81in
82.IR <unistd.h> .
47297adb 83.SH RETURN VALUE
fea681da 84On success,
e511ffb6 85.BR sched_get_priority_max ()
fea681da 86and
e511ffb6 87.BR sched_get_priority_min ()
fea681da
MK
88return the maximum/minimum priority value for the named scheduling
89policy.
92c37d8c 90On error, \-1 is returned, and
fea681da 91.I errno
f6a4078b 92is set to indicate the error.
fea681da
MK
93.SH ERRORS
94.TP
95.B EINVAL
c6fa0841
MK
96The argument
97.I policy
98does not identify a defined scheduling policy.
3113c7f3 99.SH STANDARDS
4131356c
AC
100POSIX.1-2008.
101.SH HISTORY
102POSIX.1-2001.
47297adb 103.SH SEE ALSO
ca8a0bd2
MK
104.ad l
105.nh
fea681da
MK
106.BR sched_getaffinity (2),
107.BR sched_getparam (2),
108.BR sched_getscheduler (2),
109.BR sched_setaffinity (2),
110.BR sched_setparam (2),
a0102365
MK
111.BR sched_setscheduler (2),
112.BR sched (7)