]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 |
2 | .\" | |
6a8d8745 | 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 | .\" | |
973a928a | 29 | .TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "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> | |
34 | .sp | |
ca313a68 | 35 | .BI "int sched_get_priority_max(int " policy ); |
fea681da | 36 | .sp |
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 |
a8d55537 | 41 | scheduling algorithm identified by \fIpolicy\fP. |
e511ffb6 | 42 | .BR sched_get_priority_min () |
fea681da | 43 | returns the minimum priority value that can be used with the |
a8d55537 MK |
44 | scheduling algorithm identified by \fIpolicy\fP. |
45 | Supported \fIpolicy\fP | |
fea681da | 46 | values are |
5917ad3d MK |
47 | .BR SCHED_FIFO , |
48 | .BR SCHED_RR , | |
49 | .BR SCHED_OTHER , | |
c13182ef | 50 | and |
5917ad3d | 51 | .BR SCHED_BATCH . |
92c37d8c MK |
52 | Further details about these policies can be found in |
53 | .BR sched_setscheduler (2). | |
fea681da MK |
54 | |
55 | Processes with numerically higher priority values are scheduled before | |
c13182ef MK |
56 | processes with numerically lower priority values. |
57 | Thus, the value | |
60a90ecd MK |
58 | returned by |
59 | .BR sched_get_priority_max () | |
60 | will be greater than the | |
61 | value returned by | |
62 | .BR sched_get_priority_min (). | |
fea681da MK |
63 | |
64 | Linux allows the static priority value range 1 to 99 for | |
a8d55537 MK |
65 | \fBSCHED_FIFO\fP and \fBSCHED_RR\fP and the priority 0 for |
66 | \fBSCHED_OTHER\fP and \fBSCHED_BATCH\fP. | |
92c37d8c | 67 | Scheduling priority ranges for the various policies |
fea681da MK |
68 | are not alterable. |
69 | ||
70 | The range of scheduling priorities may vary on other POSIX systems, | |
71 | thus it is a good idea for portable applications to use a virtual | |
72 | priority range and map it to the interval given by | |
60a90ecd MK |
73 | .BR sched_get_priority_max () |
74 | and | |
75 | .BR sched_get_priority_min (). | |
a7fadb55 | 76 | POSIX.1-2001 requires a spread of at least 32 between the maximum and the |
a8d55537 | 77 | minimum values for \fBSCHED_FIFO\fP and \fBSCHED_RR\fP. |
fea681da MK |
78 | |
79 | POSIX systems on which | |
e511ffb6 | 80 | .BR sched_get_priority_max () |
fea681da | 81 | and |
e511ffb6 | 82 | .BR sched_get_priority_min () |
fea681da | 83 | are available define |
f25eaea8 | 84 | .B _POSIX_PRIORITY_SCHEDULING |
c84371c6 | 85 | in \fI<unistd.h>\fP. |
47297adb | 86 | .SH RETURN VALUE |
fea681da | 87 | On success, |
e511ffb6 | 88 | .BR sched_get_priority_max () |
fea681da | 89 | and |
e511ffb6 | 90 | .BR sched_get_priority_min () |
fea681da MK |
91 | return the maximum/minimum priority value for the named scheduling |
92 | policy. | |
92c37d8c | 93 | On error, \-1 is returned, and |
fea681da MK |
94 | .I errno |
95 | is set appropriately. | |
96 | .SH ERRORS | |
97 | .TP | |
98 | .B EINVAL | |
c4bb193f | 99 | The argument \fIpolicy\fP does not identify a defined scheduling policy. |
47297adb | 100 | .SH CONFORMING TO |
97c1eac8 | 101 | POSIX.1-2001. |
47297adb | 102 | .SH SEE ALSO |
ca8a0bd2 MK |
103 | .ad l |
104 | .nh | |
fea681da MK |
105 | .BR sched_getaffinity (2), |
106 | .BR sched_getparam (2), | |
107 | .BR sched_getscheduler (2), | |
108 | .BR sched_setaffinity (2), | |
109 | .BR sched_setparam (2), | |
110 | .BR sched_setscheduler (2) | |
111 | .PP | |
fea681da | 112 | .I Programming for the real world \- POSIX.4 |
173fe7e7 | 113 | by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0. |