scripts/bash_aliases: tfix
[man-pages.git] / man2 / sched_get_priority_max.2
blob2afd886818d14d7cb4ecffe3421fc9c133146877
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 2021-03-22 "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 .nf
34 .B #include <sched.h>
35 .PP
36 .BI "int sched_get_priority_max(int " policy );
37 .BI "int sched_get_priority_min(int " policy );
38 .fi
39 .SH DESCRIPTION
40 .BR sched_get_priority_max ()
41 returns the maximum priority value that can be used with the
42 scheduling algorithm identified by
43 .IR policy .
44 .BR sched_get_priority_min ()
45 returns the minimum priority value that can be used with the
46 scheduling algorithm identified by
47 .IR policy .
48 Supported
49 .I policy
50 values are
51 .BR SCHED_FIFO ,
52 .BR SCHED_RR ,
53 .BR SCHED_OTHER ,
54 .BR SCHED_BATCH ,
55 .BR SCHED_IDLE ,
56 and
57 .BR SCHED_DEADLINE .
58 Further details about these policies can be found in
59 .BR sched (7).
60 .PP
61 Processes with numerically higher priority values are scheduled before
62 processes with numerically lower priority values.
63 Thus, the value
64 returned by
65 .BR sched_get_priority_max ()
66 will be greater than the
67 value returned by
68 .BR sched_get_priority_min ().
69 .PP
70 Linux allows the static priority range 1 to 99 for the
71 .B SCHED_FIFO
72 and
73 .B SCHED_RR
74 policies, and the priority 0 for the remaining policies.
75 Scheduling priority ranges for the various policies
76 are not alterable.
77 .PP
78 The range of scheduling priorities may vary on other POSIX systems,
79 thus it is a good idea for portable applications to use a virtual
80 priority range and map it to the interval given by
81 .BR sched_get_priority_max ()
82 and
83 .BR sched_get_priority_min ()
84 POSIX.1 requires
85 .\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
86 a spread of at least 32 between the maximum and the minimum values for
87 .B SCHED_FIFO
88 and
89 .BR SCHED_RR .
90 .PP
91 POSIX systems on which
92 .BR sched_get_priority_max ()
93 and
94 .BR sched_get_priority_min ()
95 are available define
96 .B _POSIX_PRIORITY_SCHEDULING
98 .IR <unistd.h> .
99 .SH RETURN VALUE
100 On success,
101 .BR sched_get_priority_max ()
103 .BR sched_get_priority_min ()
104 return the maximum/minimum priority value for the named scheduling
105 policy.
106 On error, \-1 is returned, and
107 .I errno
108 is set to indicate the error.
109 .SH ERRORS
111 .B EINVAL
112 The argument
113 .I policy
114 does not identify a defined scheduling policy.
115 .SH CONFORMING TO
116 POSIX.1-2001, POSIX.1-2008.
117 .SH SEE ALSO
118 .ad l
120 .BR sched_getaffinity (2),
121 .BR sched_getparam (2),
122 .BR sched_getscheduler (2),
123 .BR sched_setaffinity (2),
124 .BR sched_setparam (2),
125 .BR sched_setscheduler (2),
126 .BR sched (7)