]> git.ipfire.org Git - thirdparty/man-pages.git/blame_incremental - man2/sched_get_priority_max.2
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man2 / sched_get_priority_max.2
... / ...
CommitLineData
1.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
2.\"
3.\" SPDX-License-Identifier: GPL-2.0-or-later
4.\"
5.\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
6.\" First version written
7.\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
8.\" revision
9.\"
10.TH sched_get_priority_max 2 (date) "Linux man-pages (unreleased)"
11.SH NAME
12sched_get_priority_max, sched_get_priority_min \- get static priority range
13.SH LIBRARY
14Standard C library
15.RI ( libc ", " \-lc )
16.SH SYNOPSIS
17.nf
18.B #include <sched.h>
19.P
20.BI "int sched_get_priority_max(int " policy );
21.BI "int sched_get_priority_min(int " policy );
22.fi
23.SH DESCRIPTION
24.BR sched_get_priority_max ()
25returns the maximum priority value that can be used with the
26scheduling algorithm identified by
27.IR policy .
28.BR sched_get_priority_min ()
29returns the minimum priority value that can be used with the
30scheduling algorithm identified by
31.IR policy .
32Supported
33.I policy
34values are
35.BR SCHED_FIFO ,
36.BR SCHED_RR ,
37.BR SCHED_OTHER ,
38.BR SCHED_BATCH ,
39.BR SCHED_IDLE ,
40and
41.BR SCHED_DEADLINE .
42Further details about these policies can be found in
43.BR sched (7).
44.P
45Processes with numerically higher priority values are scheduled before
46processes with numerically lower priority values.
47Thus, the value
48returned by
49.BR sched_get_priority_max ()
50will be greater than the
51value returned by
52.BR sched_get_priority_min ().
53.P
54Linux allows the static priority range 1 to 99 for the
55.B SCHED_FIFO
56and
57.B SCHED_RR
58policies, and the priority 0 for the remaining policies.
59Scheduling priority ranges for the various policies
60are not alterable.
61.P
62The range of scheduling priorities may vary on other POSIX systems,
63thus it is a good idea for portable applications to use a virtual
64priority range and map it to the interval given by
65.BR sched_get_priority_max ()
66and
67.BR sched_get_priority_min ()
68POSIX.1 requires
69.\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
70a spread of at least 32 between the maximum and the minimum values for
71.B SCHED_FIFO
72and
73.BR SCHED_RR .
74.P
75POSIX systems on which
76.BR sched_get_priority_max ()
77and
78.BR sched_get_priority_min ()
79are available define
80.B _POSIX_PRIORITY_SCHEDULING
81in
82.IR <unistd.h> .
83.SH RETURN VALUE
84On success,
85.BR sched_get_priority_max ()
86and
87.BR sched_get_priority_min ()
88return the maximum/minimum priority value for the named scheduling
89policy.
90On error, \-1 is returned, and
91.I errno
92is set to indicate the error.
93.SH ERRORS
94.TP
95.B EINVAL
96The argument
97.I policy
98does not identify a defined scheduling policy.
99.SH STANDARDS
100POSIX.1-2008.
101.SH HISTORY
102POSIX.1-2001.
103.SH SEE ALSO
104.ad l
105.nh
106.BR sched_getaffinity (2),
107.BR sched_getparam (2),
108.BR sched_getscheduler (2),
109.BR sched_setaffinity (2),
110.BR sched_setparam (2),
111.BR sched_setscheduler (2),
112.BR sched (7)