OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man2 / sched_get_priority_max.2
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 SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "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 .BI "int sched_get_priority_max(int " policy );
37 .sp
38 .BI "int sched_get_priority_min(int " policy );
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 \fIpolicy\fP.
43 .BR sched_get_priority_min ()
44 returns the minimum priority value that can be used with the
45 scheduling algorithm identified by \fIpolicy\fP.
46 Supported \fIpolicy\fP
47 values are
48 .BR SCHED_FIFO ,
49 .BR SCHED_RR ,
50 .BR SCHED_OTHER ,
51 and
52 .BR SCHED_BATCH .
53 Further details about these policies can be found in
54 .BR sched_setscheduler (2).
55
56 Processes with numerically higher priority values are scheduled before
57 processes with numerically lower priority values.
58 Thus, the value
59 returned by
60 .BR sched_get_priority_max ()
61 will be greater than the
62 value returned by
63 .BR sched_get_priority_min ().
64
65 Linux allows the static priority value range 1 to 99 for
66 \fBSCHED_FIFO\fP and \fBSCHED_RR\fP and the priority 0 for
67 \fBSCHED_OTHER\fP and \fBSCHED_BATCH\fP.
68 Scheduling priority ranges for the various policies
69 are not alterable.
70
71 The range of scheduling priorities may vary on other POSIX systems,
72 thus it is a good idea for portable applications to use a virtual
73 priority range and map it to the interval given by
74 .BR sched_get_priority_max ()
75 and
76 .BR sched_get_priority_min ().
77 POSIX.1-2001 requires a spread of at least 32 between the maximum and the
78 minimum values for \fBSCHED_FIFO\fP and \fBSCHED_RR\fP.
79
80 POSIX systems on which
81 .BR sched_get_priority_max ()
82 and
83 .BR sched_get_priority_min ()
84 are available define
85 .B _POSIX_PRIORITY_SCHEDULING
86 in \fI<unistd.h>\fP.
87 .SH "RETURN VALUE"
88 On success,
89 .BR sched_get_priority_max ()
90 and
91 .BR sched_get_priority_min ()
92 return the maximum/minimum priority value for the named scheduling
93 policy.
94 On error, \-1 is returned, and
95 .I errno
96 is set appropriately.
97 .SH ERRORS
98 .TP
99 .B EINVAL
100 The argument \fIpolicy\fP does not identify a defined scheduling policy.
101 .SH "CONFORMING TO"
102 POSIX.1-2001.
103 .SH "SEE ALSO"
104 .BR sched_getaffinity (2),
105 .BR sched_getparam (2),
106 .BR sched_getscheduler (2),
107 .BR sched_setaffinity (2),
108 .BR sched_setparam (2),
109 .BR sched_setscheduler (2)
110 .PP
111 .I Programming for the real world \- POSIX.4
112 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0