OSDN Git Service

f712fa2bedf8fe70235737c8be762185a65ce363
[linuxjm/LDP_man-pages.git] / original / 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 2013-09-23 "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 .sp
35 .BI "int sched_get_priority_max(int " policy );
36 .sp
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 and
55 .BR SCHED_IDLE .
56 Further details about these policies can be found in
57 .BR sched_setscheduler (2).
58
59 Processes with numerically higher priority values are scheduled before
60 processes with numerically lower priority values.
61 Thus, the value
62 returned by
63 .BR sched_get_priority_max ()
64 will be greater than the
65 value returned by
66 .BR sched_get_priority_min ().
67
68 Linux allows the static priority value range 1 to 99 for
69 .B SCHED_FIFO
70 and
71 .B SCHED_RR
72 and the priority 0 for
73 .BR SCHED_OTHER ,
74 .BR SCHED_BATCH ,
75 and
76 .BR SCHED_IDLE .
77 Scheduling priority ranges for the various policies
78 are not alterable.
79
80 The range of scheduling priorities may vary on other POSIX systems,
81 thus it is a good idea for portable applications to use a virtual
82 priority range and map it to the interval given by
83 .BR sched_get_priority_max ()
84 and
85 .BR sched_get_priority_min ().
86 POSIX.1-2001 requires a spread of at least 32 between the maximum and the
87 minimum values for
88 .B SCHED_FIFO
89 and
90 .BR SCHED_RR .
91
92 POSIX systems on which
93 .BR sched_get_priority_max ()
94 and
95 .BR sched_get_priority_min ()
96 are available define
97 .B _POSIX_PRIORITY_SCHEDULING
98 in
99 .IR <unistd.h> .
100 .SH RETURN VALUE
101 On success,
102 .BR sched_get_priority_max ()
103 and
104 .BR sched_get_priority_min ()
105 return the maximum/minimum priority value for the named scheduling
106 policy.
107 On error, \-1 is returned, and
108 .I errno
109 is set appropriately.
110 .SH ERRORS
111 .TP
112 .B EINVAL
113 The argument
114 .I policy
115 does not identify a defined scheduling policy.
116 .SH CONFORMING TO
117 POSIX.1-2001.
118 .SH SEE ALSO
119 .ad l
120 .nh
121 .BR sched_getaffinity (2),
122 .BR sched_getparam (2),
123 .BR sched_getscheduler (2),
124 .BR sched_setaffinity (2),
125 .BR sched_setparam (2),
126 .BR sched_setscheduler (2)
127 .PP
128 .I Programming for the real world \- POSIX.4
129 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0.
130 .SH COLOPHON
131 This page is part of release 3.64 of the Linux
132 .I man-pages
133 project.
134 A description of the project,
135 and information about reporting bugs,
136 can be found at
137 \%http://www.kernel.org/doc/man\-pages/.