1sched.h(0P) POSIX Programmer's Manual sched.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 sched.h — execution scheduling
13
15 #include <sched.h>
16
18 The <sched.h> header shall define the pid_t type as described in
19 <sys/types.h>.
20
21 The <sched.h> header shall define the time_t type as described in
22 <sys/types.h>.
23
24 The <sched.h> header shall define the timespec structure as described
25 in <time.h>.
26
27 The <sched.h> header shall define the sched_param structure, which
28 shall include the scheduling parameters required for implementation of
29 each supported scheduling policy. This structure shall include at least
30 the following member:
31
32
33 int sched_priority Process or thread execution scheduling priority.
34
35 The sched_param structure defined in <sched.h> shall include the fol‐
36 lowing members in addition to those specified above:
37
38
39 int sched_ss_low_priority Low scheduling priority for
40 sporadic server.
41 struct timespec sched_ss_repl_period Replenishment period for
42 sporadic server.
43 struct timespec sched_ss_init_budget Initial budget for sporadic server.
44 int sched_ss_max_repl Maximum pending replenishments for
45 sporadic server.
46
47 Each process or thread is controlled by an associated scheduling policy
48 and priority. Associated with each policy is a priority range. Each
49 policy definition specifies the minimum priority range for that policy.
50 The priority ranges for each policy may overlap the priority ranges of
51 other policies.
52
53 Four scheduling policies are defined; others may be defined by the
54 implementation. The four standard policies are indicated by the values
55 of the following symbolic constants:
56
57 SCHED_FIFO First in-first out (FIFO) scheduling policy.
58
59 SCHED_RR Round robin scheduling policy.
60
61 SCHED_SPORADIC
62 Sporadic server scheduling policy.
63
64 SCHED_OTHER Another scheduling policy.
65
66 The values of these constants are distinct.
67
68 The following shall be declared as functions and may also be defined as
69 macros. Function prototypes shall be provided.
70
71
72 int sched_get_priority_max(int);
73 int sched_get_priority_min(int);
74 int sched_getparam(pid_t, struct sched_param *);
75 int sched_getscheduler(pid_t);
76 int sched_rr_get_interval(pid_t, struct timespec *);
77 int sched_setparam(pid_t, const struct sched_param *);
78 int sched_setscheduler(pid_t, int, const struct sched_param *);
79 int sched_yield(void);
80
81 Inclusion of the <sched.h> header may make visible all symbols from the
82 <time.h> header.
83
84 The following sections are informative.
85
87 None.
88
90 None.
91
93 None.
94
96 <sys_types.h>, <time.h>
97
98 The System Interfaces volume of POSIX.1‐2017, sched_get_priority_max(),
99 sched_getparam(), sched_getscheduler(), sched_rr_get_interval(),
100 sched_setparam(), sched_setscheduler(), sched_yield()
101
103 Portions of this text are reprinted and reproduced in electronic form
104 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
105 table Operating System Interface (POSIX), The Open Group Base Specifi‐
106 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
107 Electrical and Electronics Engineers, Inc and The Open Group. In the
108 event of any discrepancy between this version and the original IEEE and
109 The Open Group Standard, the original IEEE and The Open Group Standard
110 is the referee document. The original Standard can be obtained online
111 at http://www.opengroup.org/unix/online.html .
112
113 Any typographical or formatting errors that appear in this page are
114 most likely to have been introduced during the conversion of the source
115 files to man page format. To report such errors, see https://www.ker‐
116 nel.org/doc/man-pages/reporting_bugs.html .
117
118
119
120IEEE/The Open Group 2017 sched.h(0P)