199 lines
4.4 KiB
HTML
199 lines
4.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SCHED_GET_PRIORITY_MAX</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SCHED_GET_PRIORITY_MAX</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sched_get_priority_max, sched_get_priority_min - get static priority range
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/sched.h">sched.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<B>int sched_get_priority_max(int </B><I>policy</I><B>);</B>
|
|
|
|
<P>
|
|
|
|
<B>int sched_get_priority_min(int </B><I>policy</I><B>);</B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>sched_get_priority_max</B>()
|
|
|
|
returns the maximum priority value that can be used with the
|
|
scheduling algorithm identified by
|
|
<I>policy</I>.
|
|
|
|
<B>sched_get_priority_min</B>()
|
|
|
|
returns the minimum priority value that can be used with the
|
|
scheduling algorithm identified by
|
|
<I>policy</I>.
|
|
|
|
Supported
|
|
<I>policy</I>
|
|
|
|
values are
|
|
<B>SCHED_FIFO</B>,
|
|
|
|
<B>SCHED_RR</B>,
|
|
|
|
<B>SCHED_OTHER</B>,
|
|
|
|
<B>SCHED_BATCH</B>,
|
|
|
|
<B>SCHED_IDLE</B>,
|
|
|
|
and
|
|
<B>SCHED_DEADLINE</B>.
|
|
|
|
Further details about these policies can be found in
|
|
<B><A HREF="/cgi-bin/man/man2html?7+sched">sched</A></B>(7).
|
|
|
|
<P>
|
|
|
|
Processes with numerically higher priority values are scheduled before
|
|
processes with numerically lower priority values.
|
|
Thus, the value
|
|
returned by
|
|
<B>sched_get_priority_max</B>()
|
|
|
|
will be greater than the
|
|
value returned by
|
|
<B>sched_get_priority_min</B>().
|
|
|
|
<P>
|
|
|
|
Linux allows the static priority range 1 to 99 for the
|
|
<B>SCHED_FIFO</B>
|
|
|
|
and
|
|
<B>SCHED_RR</B>
|
|
|
|
policies, and the priority 0 for the remaining policies.
|
|
Scheduling priority ranges for the various policies
|
|
are not alterable.
|
|
<P>
|
|
|
|
The range of scheduling priorities may vary on other POSIX systems,
|
|
thus it is a good idea for portable applications to use a virtual
|
|
priority range and map it to the interval given by
|
|
<B>sched_get_priority_max</B>()
|
|
|
|
and
|
|
<B>sched_get_priority_min</B>
|
|
|
|
POSIX.1 requires
|
|
|
|
a spread of at least 32 between the maximum and the minimum values for
|
|
<B>SCHED_FIFO</B>
|
|
|
|
and
|
|
<B>SCHED_RR</B>.
|
|
|
|
<P>
|
|
|
|
POSIX systems on which
|
|
<B>sched_get_priority_max</B>()
|
|
|
|
and
|
|
<B>sched_get_priority_min</B>()
|
|
|
|
are available define
|
|
<B>_POSIX_PRIORITY_SCHEDULING</B>
|
|
|
|
in
|
|
<I><<A HREF="file:///usr/include/unistd.h">unistd.h</A>></I>.
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success,
|
|
<B>sched_get_priority_max</B>()
|
|
|
|
and
|
|
<B>sched_get_priority_min</B>()
|
|
|
|
return the maximum/minimum priority value for the named scheduling
|
|
policy.
|
|
On error, -1 is returned, and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>EINVAL</B>
|
|
|
|
<DD>
|
|
The argument
|
|
<I>policy</I>
|
|
|
|
does not identify a defined scheduling policy.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
POSIX.1-2001, POSIX.1-2008.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_getaffinity">sched_getaffinity</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_getparam">sched_getparam</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_getscheduler">sched_getscheduler</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_setaffinity">sched_setaffinity</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_setparam">sched_setparam</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+sched_setscheduler">sched_setscheduler</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+sched">sched</A></B>(7)
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="6"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="7"><A HREF="#lbAG">CONFORMING TO</A><DD>
|
|
<DT id="8"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="9"><A HREF="#lbAI">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:34 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|