]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996 |
2 | .\" | |
e4a74ca8 | 3 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
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 | .\" | |
4c1c5274 | 10 | .TH sched_get_priority_max 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
11 | .SH NAME |
12 | sched_get_priority_max, sched_get_priority_min \- get static priority range | |
96e2debd AC |
13 | .SH LIBRARY |
14 | Standard C library | |
8fc3b2cf | 15 | .RI ( libc ", " \-lc ) |
fea681da | 16 | .SH SYNOPSIS |
15d65653 | 17 | .nf |
fea681da | 18 | .B #include <sched.h> |
c6d039a3 | 19 | .P |
ca313a68 | 20 | .BI "int sched_get_priority_max(int " policy ); |
ca313a68 | 21 | .BI "int sched_get_priority_min(int " policy ); |
15d65653 | 22 | .fi |
fea681da | 23 | .SH DESCRIPTION |
e511ffb6 | 24 | .BR sched_get_priority_max () |
fea681da | 25 | returns the maximum priority value that can be used with the |
c6fa0841 MK |
26 | scheduling algorithm identified by |
27 | .IR policy . | |
e511ffb6 | 28 | .BR sched_get_priority_min () |
fea681da | 29 | returns the minimum priority value that can be used with the |
c6fa0841 MK |
30 | scheduling algorithm identified by |
31 | .IR policy . | |
32 | Supported | |
33 | .I policy | |
fea681da | 34 | values are |
5917ad3d MK |
35 | .BR SCHED_FIFO , |
36 | .BR SCHED_RR , | |
37 | .BR SCHED_OTHER , | |
4f56bc07 | 38 | .BR SCHED_BATCH , |
ce97aba3 | 39 | .BR SCHED_IDLE , |
c13182ef | 40 | and |
ce97aba3 | 41 | .BR SCHED_DEADLINE . |
92c37d8c | 42 | Further details about these policies can be found in |
a0102365 | 43 | .BR sched (7). |
c6d039a3 | 44 | .P |
fea681da | 45 | Processes with numerically higher priority values are scheduled before |
c13182ef MK |
46 | processes with numerically lower priority values. |
47 | Thus, the value | |
60a90ecd MK |
48 | returned by |
49 | .BR sched_get_priority_max () | |
50 | will be greater than the | |
51 | value returned by | |
52 | .BR sched_get_priority_min (). | |
c6d039a3 | 53 | .P |
72a80539 | 54 | Linux allows the static priority range 1 to 99 for the |
c6fa0841 MK |
55 | .B SCHED_FIFO |
56 | and | |
57 | .B SCHED_RR | |
72a80539 | 58 | policies, and the priority 0 for the remaining policies. |
92c37d8c | 59 | Scheduling priority ranges for the various policies |
fea681da | 60 | are not alterable. |
c6d039a3 | 61 | .P |
fea681da MK |
62 | The range of scheduling priorities may vary on other POSIX systems, |
63 | thus it is a good idea for portable applications to use a virtual | |
64 | priority range and map it to the interval given by | |
60a90ecd MK |
65 | .BR sched_get_priority_max () |
66 | and | |
4cc91169 | 67 | .BR sched_get_priority_min () |
5f2ccde3 MK |
68 | POSIX.1 requires |
69 | .\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4) | |
70 | a spread of at least 32 between the maximum and the minimum values for | |
c6fa0841 MK |
71 | .B SCHED_FIFO |
72 | and | |
73 | .BR SCHED_RR . | |
c6d039a3 | 74 | .P |
fea681da | 75 | POSIX systems on which |
e511ffb6 | 76 | .BR sched_get_priority_max () |
fea681da | 77 | and |
e511ffb6 | 78 | .BR sched_get_priority_min () |
fea681da | 79 | are available define |
f25eaea8 | 80 | .B _POSIX_PRIORITY_SCHEDULING |
c6fa0841 MK |
81 | in |
82 | .IR <unistd.h> . | |
47297adb | 83 | .SH RETURN VALUE |
fea681da | 84 | On success, |
e511ffb6 | 85 | .BR sched_get_priority_max () |
fea681da | 86 | and |
e511ffb6 | 87 | .BR sched_get_priority_min () |
fea681da MK |
88 | return the maximum/minimum priority value for the named scheduling |
89 | policy. | |
92c37d8c | 90 | On error, \-1 is returned, and |
fea681da | 91 | .I errno |
f6a4078b | 92 | is set to indicate the error. |
fea681da MK |
93 | .SH ERRORS |
94 | .TP | |
95 | .B EINVAL | |
c6fa0841 MK |
96 | The argument |
97 | .I policy | |
98 | does not identify a defined scheduling policy. | |
3113c7f3 | 99 | .SH STANDARDS |
4131356c AC |
100 | POSIX.1-2008. |
101 | .SH HISTORY | |
102 | POSIX.1-2001. | |
47297adb | 103 | .SH SEE ALSO |
ca8a0bd2 MK |
104 | .ad l |
105 | .nh | |
fea681da MK |
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), | |
a0102365 MK |
111 | .BR sched_setscheduler (2), |
112 | .BR sched (7) |