version 4, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
SCHED_SETPARAM |
|
|
2 |
!!!SCHED_SETPARAM |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
ERRORS |
|
|
8 |
CONFORMING TO |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
sched_setparam, sched_getparam - set and get scheduling parameters |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include __ |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
__int sched_setparam(pid_t__ ''pid''__, const struct |
|
|
22 |
sched_param *__''p''__);__ |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
__int sched_getparam(pid_t__ ''pid''__, struct |
|
|
26 |
sched_param *__''p''__);__ |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
struct sched_param { |
|
|
30 |
... |
|
|
31 |
int ''sched_priority''__; |
|
|
32 |
... |
|
|
33 |
}; |
|
|
34 |
__ |
|
|
35 |
!!DESCRIPTION |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
__sched_setparam__ sets the scheduling parameters |
|
|
39 |
associated with the scheduling policy for the process |
|
|
40 |
identified by ''pid''. If ''pid'' is zero, then the |
|
|
41 |
parameters of the current process are set. The |
|
|
42 |
interpretation of the parameter ''p'' depends on the |
|
|
43 |
selected policy. Currently, the following three scheduling |
|
|
44 |
policies are supported under Linux: ''SCHED_FIFO'', |
|
|
45 |
''SCHED_RR'', and ''SCHED_OTHER.'' |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
__sched_getparam__ retrieves the scheduling parameters |
|
|
49 |
for the process identified by ''pid''. If ''pid'' is |
|
|
50 |
zero, then the parameters of the current process are |
|
|
51 |
retrieved. |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
__sched_setparam__ checks the validity of ''p'' for |
|
|
55 |
the scheduling policy of the process. The parameter |
|
|
56 |
''p-'' must lie within the range given |
|
|
57 |
by __sched_get_priority_min__ and |
|
|
58 |
__sched_get_priority_max__. |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
POSIX systems on which __sched_setparam__ and |
|
|
62 |
__sched_getparam__ are available define |
|
|
63 |
''_POSIX_PRIORITY_SCHEDULING'' in |
|
|
64 |
'' |
|
|
65 |
!!RETURN VALUE |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
On success, __sched_setparam__ and __sched_getparam__ |
|
|
69 |
return 0. On error, -1 is returned, ''errno'' is set |
|
|
70 |
appropriately. |
|
|
71 |
!!ERRORS |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
__ESRCH__ |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
The process whose ID is ''pid'' could not be |
|
|
78 |
found. |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
__EPERM__ |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
The calling process does not have appropriate privileges. |
|
|
85 |
The process calling __sched_setparam__ needs an effective |
|
|
86 |
uid equal to the euid or uid of the process identified by |
|
|
87 |
''pid'', or it must be a superuser process. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__EINVAL__ |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
The parameter ''p'' does not make sense for the current |
|
|
94 |
scheduling policy. |
|
|
95 |
!!CONFORMING TO |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
POSIX.1b (formerly POSIX.4) |
|
|
99 |
!!SEE ALSO |
|
|
100 |
|
|
|
101 |
|
4 |
perry |
102 |
sched_setscheduler(2), __sched_getscheduler__(2), |
|
|
103 |
sched_get_priority_max(2), |
|
|
104 |
sched_get_priority_min(2), nice(2), |
1 |
perry |
105 |
setpriority(2), getpriority(2), |
|
|
106 |
|
|
|
107 |
|
4 |
perry |
108 |
sched_setscheduler(2) has a description of the Linux |
1 |
perry |
109 |
scheduling scheme. |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
''Programming for the real world - POSIX.4'' by Bill O. |
|
|
113 |
Gallmeister, O'Reilly |
|
|
114 |
'' |
|
|
115 |
IEEE Std 1003.1b-1993'' (POSIX.1b standard)'' |
|
|
116 |
ISO/IEC 9945-1:1996'' |
|
|
117 |
---- |