1sched_get_priority_max(2)     System Calls 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

LIBRARY

10       Standard C library (libc, -lc)
11

SYNOPSIS

13       #include <sched.h>
14
15       int sched_get_priority_max(int policy);
16       int sched_get_priority_min(int policy);
17

DESCRIPTION

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

RETURN VALUE

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

ERRORS

53       EINVAL The argument policy does not identify a defined scheduling  pol‐
54              icy.
55

STANDARDS

57       POSIX.1-2008.
58

HISTORY

60       POSIX.1-2001.
61

SEE ALSO

63       sched_getaffinity(2), sched_getparam(2), sched_getscheduler(2),
64       sched_setaffinity(2), sched_setparam(2), sched_setscheduler(2),
65       sched(7)
66
67
68
69Linux man-pages 6.05              2023-03-30         sched_get_priority_max(2)
Impressum