1SCHED_SETPARAM(2) Linux Programmer's Manual SCHED_SETPARAM(2)
2
3
4
6 sched_setparam, sched_getparam - set and get scheduling parameters
7
9 #include <sched.h>
10
11 int sched_setparam(pid_t pid, const struct sched_param *param);
12
13 int sched_getparam(pid_t pid, struct sched_param *param);
14
15 struct sched_param {
16 ...
17 int sched_priority;
18 ...
19 };
20
22 sched_setparam() sets the scheduling parameters associated with the
23 scheduling policy for the process identified by pid. If pid is zero,
24 then the parameters of the current process are set. The interpretation
25 of the parameter param depends on the scheduling policy of the process
26 identified by pid. See sched_setscheduler(2) for a description of the
27 scheduling policies supported under Linux.
28
29 sched_getparam() retrieves the scheduling parameters for the process
30 identified by pid. If pid is zero, then the parameters of the current
31 process are retrieved.
32
33 sched_setparam() checks the validity of param for the scheduling policy
34 of the process. The parameter param->sched_priority must lie within the
35 range given by sched_get_priority_min(2) and sched_get_priority_max(2).
36
37 For a discussion of the privileges and resource limits related to
38 scheduling priority and policy, see sched_setscheduler(2).
39
40 POSIX systems on which sched_setparam() and sched_getparam() are avail‐
41 able define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
42
44 On success, sched_setparam() and sched_getparam() return 0. On error,
45 -1 is returned, and errno is set appropriately.
46
48 EINVAL The parameter param does not make sense for the current schedul‐
49 ing policy.
50
51 EPERM The calling process does not have appropriate privileges (Linux:
52 does not have the CAP_SYS_NICE capability).
53
54 ESRCH The process whose ID is pid could not be found.
55
57 POSIX.1-2001.
58
60 getpriority(2), nice(2), sched_get_priority_max(2), sched_get_prior‐
61 ity_min(2), sched_getaffinity(2), sched_getscheduler(2),
62 sched_setaffinity(2), sched_setscheduler(2), setpriority(2), capabili‐
63 ties(7)
64
65 Programming for the real world - POSIX.4 by Bill O. Gallmeister,
66 O'Reilly & Associates, Inc., ISBN 1-56592-074-0
67
68
69
70Linux 2.6.16 2006-03-23 SCHED_SETPARAM(2)