1SCHED_GET_PRIORITY_MAX(2)  Linux Programmer's Manual SCHED_GET_PRIORITY_MAX(2)
2
3
4

NAME

6       sched_get_priority_max,  sched_get_priority_min   - get static priority
7       range
8

SYNOPSIS

10       #include <sched.h>
11
12       int sched_get_priority_max(int policy);
13
14       int sched_get_priority_min(int policy);
15

DESCRIPTION

17       sched_get_priority_max() returns the maximum priority value that can be
18       used    with   the   scheduling   algorithm   identified   by   policy.
19       sched_get_priority_min() returns the minimum priority value that can be
20       used  with  the  scheduling  algorithm identified by policy.  Supported
21       policy  values  are  SCHED_FIFO,  SCHED_RR,  SCHED_OTHER,  SCHED_BATCH,
22       SCHED_IDLE,  and  SCHED_DEADLINE.  Further details about these policies
23       can be found in sched(7).
24
25       Processes with numerically higher priority values are scheduled  before
26       processes  with  numerically  lower  priority  values.  Thus, the value
27       returned by sched_get_priority_max() will be  greater  than  the  value
28       returned by sched_get_priority_min().
29
30       Linux  allows  the static priority range 1 to 99 for the SCHED_FIFO and
31       SCHED_RR policies, and the  priority  0  for  the  remaining  policies.
32       Scheduling priority ranges for the various policies are not alterable.
33
34       The  range  of  scheduling  priorities may vary on other POSIX systems,
35       thus it is a good idea for portable applications to use a virtual  pri‐
36       ority  range  and  map  it  to  the  interval given by sched_get_prior‐
37       ity_max() and sched_get_priority_min POSIX.1 requires a  spread  of  at
38       least  32 between the maximum and the minimum values for SCHED_FIFO and
39       SCHED_RR.
40
41       POSIX systems on which  sched_get_priority_max()  and  sched_get_prior‐
42       ity_min()    are   available   define   _POSIX_PRIORITY_SCHEDULING   in
43       <unistd.h>.
44

RETURN VALUE

46       On  success,  sched_get_priority_max()   and   sched_get_priority_min()
47       return the maximum/minimum priority value for the named scheduling pol‐
48       icy.  On error, -1 is returned, and errno is set appropriately.
49

ERRORS

51       EINVAL The argument policy does not identify a defined scheduling  pol‐
52              icy.
53

CONFORMING TO

55       POSIX.1-2001, POSIX.1-2008.
56

SEE ALSO

58       sched_getaffinity(2), sched_getparam(2), sched_getscheduler(2),
59       sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2),
60       sched(7)
61

COLOPHON

63       This page is part of release 4.15 of the Linux man-pages project.  A
64       description of the project, information about reporting bugs, and the
65       latest version of this page, can be found at
66       https://www.kernel.org/doc/man-pages/.
67
68
69
70Linux                             2017-09-15         SCHED_GET_PRIORITY_MAX(2)
Impressum