|
Packit |
7cfc04 |
.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
|
|
Packit |
7cfc04 |
.\" This is free documentation; you can redistribute it and/or
|
|
Packit |
7cfc04 |
.\" modify it under the terms of the GNU General Public License as
|
|
Packit |
7cfc04 |
.\" published by the Free Software Foundation; either version 2 of
|
|
Packit |
7cfc04 |
.\" the License, or (at your option) any later version.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" The GNU General Public License's references to "object code"
|
|
Packit |
7cfc04 |
.\" and "executables" are to be interpreted as the output of any
|
|
Packit |
7cfc04 |
.\" document formatting or typesetting system, including
|
|
Packit |
7cfc04 |
.\" intermediate and printed output.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" This manual is distributed in the hope that it will be useful,
|
|
Packit |
7cfc04 |
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
7cfc04 |
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
7cfc04 |
.\" GNU General Public License for more details.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" You should have received a copy of the GNU General Public
|
|
Packit |
7cfc04 |
.\" License along with this manual; if not, see
|
|
Packit |
7cfc04 |
.\" <http://www.gnu.org/licenses/>.
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
|
|
Packit |
7cfc04 |
.\" First version written
|
|
Packit |
7cfc04 |
.\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
|
|
Packit |
7cfc04 |
.\" revision
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH SCHED_GET_PRIORITY_MAX 2 2017-09-15 "Linux" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
sched_get_priority_max, sched_get_priority_min \- get static priority range
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.B #include <sched.h>
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "int sched_get_priority_max(int " policy );
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "int sched_get_priority_min(int " policy );
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
.BR sched_get_priority_max ()
|
|
Packit |
7cfc04 |
returns the maximum priority value that can be used with the
|
|
Packit |
7cfc04 |
scheduling algorithm identified by
|
|
Packit |
7cfc04 |
.IR policy .
|
|
Packit |
7cfc04 |
.BR sched_get_priority_min ()
|
|
Packit |
7cfc04 |
returns the minimum priority value that can be used with the
|
|
Packit |
7cfc04 |
scheduling algorithm identified by
|
|
Packit |
7cfc04 |
.IR policy .
|
|
Packit |
7cfc04 |
Supported
|
|
Packit |
7cfc04 |
.I policy
|
|
Packit |
7cfc04 |
values are
|
|
Packit |
7cfc04 |
.BR SCHED_FIFO ,
|
|
Packit |
7cfc04 |
.BR SCHED_RR ,
|
|
Packit |
7cfc04 |
.BR SCHED_OTHER ,
|
|
Packit |
7cfc04 |
.BR SCHED_BATCH ,
|
|
Packit |
7cfc04 |
.BR SCHED_IDLE ,
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR SCHED_DEADLINE .
|
|
Packit |
7cfc04 |
Further details about these policies can be found in
|
|
Packit |
7cfc04 |
.BR sched (7).
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Processes with numerically higher priority values are scheduled before
|
|
Packit |
7cfc04 |
processes with numerically lower priority values.
|
|
Packit |
7cfc04 |
Thus, the value
|
|
Packit |
7cfc04 |
returned by
|
|
Packit |
7cfc04 |
.BR sched_get_priority_max ()
|
|
Packit |
7cfc04 |
will be greater than the
|
|
Packit |
7cfc04 |
value returned by
|
|
Packit |
7cfc04 |
.BR sched_get_priority_min ().
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Linux allows the static priority range 1 to 99 for the
|
|
Packit |
7cfc04 |
.B SCHED_FIFO
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.B SCHED_RR
|
|
Packit |
7cfc04 |
policies, and the priority 0 for the remaining policies.
|
|
Packit |
7cfc04 |
Scheduling priority ranges for the various policies
|
|
Packit |
7cfc04 |
are not alterable.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The range of scheduling priorities may vary on other POSIX systems,
|
|
Packit |
7cfc04 |
thus it is a good idea for portable applications to use a virtual
|
|
Packit |
7cfc04 |
priority range and map it to the interval given by
|
|
Packit |
7cfc04 |
.BR sched_get_priority_max ()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR sched_get_priority_min
|
|
Packit |
7cfc04 |
POSIX.1 requires
|
|
Packit |
7cfc04 |
.\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
|
|
Packit |
7cfc04 |
a spread of at least 32 between the maximum and the minimum values for
|
|
Packit |
7cfc04 |
.B SCHED_FIFO
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR SCHED_RR .
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
POSIX systems on which
|
|
Packit |
7cfc04 |
.BR sched_get_priority_max ()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR sched_get_priority_min ()
|
|
Packit |
7cfc04 |
are available define
|
|
Packit |
7cfc04 |
.B _POSIX_PRIORITY_SCHEDULING
|
|
Packit |
7cfc04 |
in
|
|
Packit |
7cfc04 |
.IR <unistd.h> .
|
|
Packit |
7cfc04 |
.SH RETURN VALUE
|
|
Packit |
7cfc04 |
On success,
|
|
Packit |
7cfc04 |
.BR sched_get_priority_max ()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR sched_get_priority_min ()
|
|
Packit |
7cfc04 |
return the maximum/minimum priority value for the named scheduling
|
|
Packit |
7cfc04 |
policy.
|
|
Packit |
7cfc04 |
On error, \-1 is returned, and
|
|
Packit |
7cfc04 |
.I errno
|
|
Packit |
7cfc04 |
is set appropriately.
|
|
Packit |
7cfc04 |
.SH ERRORS
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.B EINVAL
|
|
Packit |
7cfc04 |
The argument
|
|
Packit |
7cfc04 |
.I policy
|
|
Packit |
7cfc04 |
does not identify a defined scheduling policy.
|
|
Packit |
7cfc04 |
.SH CONFORMING TO
|
|
Packit |
7cfc04 |
POSIX.1-2001, POSIX.1-2008.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.ad l
|
|
Packit |
7cfc04 |
.nh
|
|
Packit |
7cfc04 |
.BR sched_getaffinity (2),
|
|
Packit |
7cfc04 |
.BR sched_getparam (2),
|
|
Packit |
7cfc04 |
.BR sched_getscheduler (2),
|
|
Packit |
7cfc04 |
.BR sched_setaffinity (2),
|
|
Packit |
7cfc04 |
.BR sched_setparam (2),
|
|
Packit |
7cfc04 |
.BR sched_setscheduler (2),
|
|
Packit |
7cfc04 |
.BR sched (7)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|