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