]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 | |
4 | .\" | |
5 | .\" This is free documentation; you can redistribute it and/or | |
6 | .\" modify it under the terms of the GNU General Public License as | |
7 | .\" published by the Free Software Foundation; either version 2 of | |
8 | .\" the License, or (at your option) any later version. | |
9 | .\" | |
10 | .\" The GNU General Public License's references to "object code" | |
11 | .\" and "executables" are to be interpreted as the output of any | |
12 | .\" document formatting or typesetting system, including | |
13 | .\" intermediate and printed output. | |
14 | .\" | |
15 | .\" This manual is distributed in the hope that it will be useful, | |
16 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | .\" GNU General Public License for more details. | |
19 | .\" | |
20 | .\" You should have received a copy of the GNU General Public | |
21 | .\" License along with this manual; if not, write to the Free | |
22 | .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, | |
23 | .\" USA. | |
24 | .\" | |
25 | .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se> | |
26 | .\" First version written | |
27 | .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de> | |
28 | .\" revision | |
29 | .\" | |
30 | .TH GET_PRIORITY_MAX 2 1996-04-10 "Linux 1.3.81" "Linux Programmer's Manual" | |
31 | .SH NAME | |
32 | sched_get_priority_max, sched_get_priority_min \- get static priority range | |
33 | .SH SYNOPSIS | |
34 | .B #include <sched.h> | |
35 | .sp | |
36 | \fBint sched_get_priority_max(int \fIpolicy\fB); | |
37 | .sp | |
38 | \fBint sched_get_priority_min(int \fIpolicy\fB); | |
39 | .fi | |
40 | .SH DESCRIPTION | |
41 | .B sched_get_priority_max | |
42 | returns the maximum priority value that can be used with the | |
43 | scheduling algorithm identified by \fIpolicy\fR. | |
44 | .B sched_get_priority_min | |
45 | returns the minimum priority value that can be used with the | |
46 | scheduling algorithm identified by \fIpolicy\fR. Supported \fIpolicy\fR | |
47 | values are | |
48 | .IR SCHED_FIFO , | |
49 | .IR SCHED_RR , | |
50 | and | |
51 | .IR SCHED_OTHER . | |
52 | ||
53 | Processes with numerically higher priority values are scheduled before | |
54 | processes with numerically lower priority values. Thus, the value | |
55 | returned by \fBsched_get_priority_max\fR will be greater than the | |
56 | value returned by \fBsched_get_priority_min\fR. | |
57 | ||
58 | Linux allows the static priority value range 1 to 99 for | |
59 | \fISCHED_FIFO\fR and \fISCHED_RR\fR and the priority 0 for | |
60 | \fISCHED_OTHER\fR. Scheduling priority ranges for the various policies | |
61 | are not alterable. | |
62 | ||
63 | The range of scheduling priorities may vary on other POSIX systems, | |
64 | thus it is a good idea for portable applications to use a virtual | |
65 | priority range and map it to the interval given by | |
66 | \fBsched_get_priority_max\fR and \fBsched_get_priority_min\fR. | |
67 | POSIX.1b requires a spread of at least 32 between the maximum and the | |
68 | minimum values for \fISCHED_FIFO\fR and \fISCHED_RR\fR. | |
69 | ||
70 | POSIX systems on which | |
71 | .B sched_get_priority_max | |
72 | and | |
73 | .B sched_get_priority_min | |
74 | are available define | |
75 | .I _POSIX_PRIORITY_SCHEDULING | |
76 | in <unistd.h>. | |
77 | ||
78 | .SH "RETURN VALUE" | |
79 | On success, | |
80 | .B sched_get_priority_max | |
81 | and | |
82 | .B sched_get_priority_min | |
83 | return the maximum/minimum priority value for the named scheduling | |
84 | policy. | |
85 | On error, \-1 is returned, | |
86 | .I errno | |
87 | is set appropriately. | |
88 | .SH ERRORS | |
89 | .TP | |
90 | .B EINVAL | |
91 | The parameter \fIpolicy\fR does not identify a defined scheduling policy. | |
92 | .SH "CONFORMING TO" | |
93 | POSIX.1b (formerly POSIX.4) | |
94 | .SH "SEE ALSO" | |
95 | .BR sched_getaffinity (2), | |
96 | .BR sched_getparam (2), | |
97 | .BR sched_getscheduler (2), | |
98 | .BR sched_setaffinity (2), | |
99 | .BR sched_setparam (2), | |
100 | .BR sched_setscheduler (2) | |
101 | .PP | |
102 | .BR sched_setscheduler (2) | |
103 | has a description of the Linux scheduling scheme. | |
104 | .PP | |
105 | .I Programming for the real world \- POSIX.4 | |
106 | by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0 | |
107 | .br | |
108 | .I IEEE Std 1003.1b-1993 | |
109 | (POSIX.1b standard) | |
110 | .br | |
111 | .I ISO/IEC 9945-1:1996 |