]>
Commit | Line | Data |
---|---|---|
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 |
31 | sched_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 | 40 | returns the maximum priority value that can be used with the |
c6fa0841 MK |
41 | scheduling algorithm identified by |
42 | .IR policy . | |
e511ffb6 | 43 | .BR sched_get_priority_min () |
fea681da | 44 | returns the minimum priority value that can be used with the |
c6fa0841 MK |
45 | scheduling algorithm identified by |
46 | .IR policy . | |
47 | Supported | |
48 | .I policy | |
fea681da | 49 | values 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 | 55 | and |
ce97aba3 | 56 | .BR SCHED_DEADLINE . |
92c37d8c | 57 | Further details about these policies can be found in |
a0102365 | 58 | .BR sched (7). |
efeece04 | 59 | .PP |
fea681da | 60 | Processes with numerically higher priority values are scheduled before |
c13182ef MK |
61 | processes with numerically lower priority values. |
62 | Thus, the value | |
60a90ecd MK |
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 (). | |
efeece04 | 68 | .PP |
72a80539 | 69 | Linux allows the static priority range 1 to 99 for the |
c6fa0841 MK |
70 | .B SCHED_FIFO |
71 | and | |
72 | .B SCHED_RR | |
72a80539 | 73 | policies, and the priority 0 for the remaining policies. |
92c37d8c | 74 | Scheduling priority ranges for the various policies |
fea681da | 75 | are not alterable. |
efeece04 | 76 | .PP |
fea681da MK |
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 | |
60a90ecd MK |
80 | .BR sched_get_priority_max () |
81 | and | |
30ea59e7 | 82 | .BR sched_get_priority_min |
5f2ccde3 MK |
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 | |
c6fa0841 MK |
86 | .B SCHED_FIFO |
87 | and | |
88 | .BR SCHED_RR . | |
efeece04 | 89 | .PP |
fea681da | 90 | POSIX systems on which |
e511ffb6 | 91 | .BR sched_get_priority_max () |
fea681da | 92 | and |
e511ffb6 | 93 | .BR sched_get_priority_min () |
fea681da | 94 | are available define |
f25eaea8 | 95 | .B _POSIX_PRIORITY_SCHEDULING |
c6fa0841 MK |
96 | in |
97 | .IR <unistd.h> . | |
47297adb | 98 | .SH RETURN VALUE |
fea681da | 99 | On success, |
e511ffb6 | 100 | .BR sched_get_priority_max () |
fea681da | 101 | and |
e511ffb6 | 102 | .BR sched_get_priority_min () |
fea681da MK |
103 | return the maximum/minimum priority value for the named scheduling |
104 | policy. | |
92c37d8c | 105 | On error, \-1 is returned, and |
fea681da MK |
106 | .I errno |
107 | is set appropriately. | |
108 | .SH ERRORS | |
109 | .TP | |
110 | .B EINVAL | |
c6fa0841 MK |
111 | The argument |
112 | .I policy | |
113 | does not identify a defined scheduling policy. | |
47297adb | 114 | .SH CONFORMING TO |
5f2ccde3 | 115 | POSIX.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) |