]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/sched_get_priority_max.2
Import of man-pages 1.70
[thirdparty/man-pages.git] / man2 / sched_get_priority_max.2
CommitLineData
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
32sched_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
42returns the maximum priority value that can be used with the
43scheduling algorithm identified by \fIpolicy\fR.
44.B sched_get_priority_min
45returns the minimum priority value that can be used with the
46scheduling algorithm identified by \fIpolicy\fR. Supported \fIpolicy\fR
47values are
48.IR SCHED_FIFO ,
49.IR SCHED_RR ,
50and
51.IR SCHED_OTHER .
52
53Processes with numerically higher priority values are scheduled before
54processes with numerically lower priority values. Thus, the value
55returned by \fBsched_get_priority_max\fR will be greater than the
56value returned by \fBsched_get_priority_min\fR.
57
58Linux 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
61are not alterable.
62
63The range of scheduling priorities may vary on other POSIX systems,
64thus it is a good idea for portable applications to use a virtual
65priority range and map it to the interval given by
66\fBsched_get_priority_max\fR and \fBsched_get_priority_min\fR.
67POSIX.1b requires a spread of at least 32 between the maximum and the
68minimum values for \fISCHED_FIFO\fR and \fISCHED_RR\fR.
69
70POSIX systems on which
71.B sched_get_priority_max
72and
73.B sched_get_priority_min
74are available define
75.I _POSIX_PRIORITY_SCHEDULING
76in <unistd.h>.
77
78.SH "RETURN VALUE"
79On success,
80.B sched_get_priority_max
81and
82.B sched_get_priority_min
83return the maximum/minimum priority value for the named scheduling
84policy.
85On error, \-1 is returned,
86.I errno
87is set appropriately.
88.SH ERRORS
89.TP
90.B EINVAL
91The parameter \fIpolicy\fR does not identify a defined scheduling policy.
92.SH "CONFORMING TO"
93POSIX.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)
103has a description of the Linux scheduling scheme.
104.PP
105.I Programming for the real world \- POSIX.4
106by 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