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       int sched_get_priority_min(int policy);
14

DESCRIPTION

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

RETURN VALUE

45       On success, sched_get_priority_max() and  sched_get_priority_min()  re‐
46       turn  the  maximum/minimum priority value for the named scheduling pol‐
47       icy.  On error, -1 is returned, and errno is set to indicate the error.
48

ERRORS

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

CONFORMING TO

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

SEE ALSO

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

COLOPHON

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