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,  and  SCHED_BATCH.
22       Further  details  about  these policies can be found in sched_setsched‐
23       uler(2).
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 value range 1 to 99 for SCHED_FIFO and
31       SCHED_RR and the priority 0 for SCHED_OTHER and SCHED_BATCH.   Schedul‐
32       ing 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-2001 requires a spread
38       of  at  least  32  between  the  maximum  and  the  minimum  values for
39       SCHED_FIFO and 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.
56

SEE ALSO

58       sched_getaffinity(2),     sched_getparam(2),     sched_getscheduler(2),
59       sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2)
60
61       Programming for the real  world  -  POSIX.4  by  Bill  O.  Gallmeister,
62       O'Reilly & Associates, Inc., ISBN 1-56592-074-0
63

COLOPHON

65       This  page  is  part of release 3.25 of the Linux man-pages project.  A
66       description of the project, and information about reporting  bugs,  can
67       be found at http://www.kernel.org/doc/man-pages/.
68
69
70
71Linux                             2006-03-23         SCHED_GET_PRIORITY_MAX(2)
Impressum