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
11
13 sched.h — execution scheduling
14
16 #include <sched.h>
17
19 The <sched.h> header shall define the pid_t type as described in
20 <sys/types.h>.
21
22 The <sched.h> header shall define the time_t type as described in
23 <sys/types.h>.
24
25 The <sched.h> header shall define the timespec structure as described
26 in <time.h>.
27
28 The <sched.h> header shall define the sched_param structure, which
29 shall include the scheduling parameters required for implementation of
30 each supported scheduling policy. This structure shall include at least
31 the following member:
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 int sched_ss_low_priority Low scheduling priority for
39 sporadic server.
40 struct timespec sched_ss_repl_period Replenishment period for
41 sporadic server.
42 struct timespec sched_ss_init_budget Initial budget for sporadic server.
43 int sched_ss_max_repl Maximum pending replenishments for
44 sporadic server.
45
46 Each process or thread is controlled by an associated scheduling policy
47 and priority. Associated with each policy is a priority range. Each
48 policy definition specifies the minimum priority range for that policy.
49 The priority ranges for each policy may overlap the priority ranges of
50 other policies.
51
52 Four scheduling policies are defined; others may be defined by the
53 implementation. The four standard policies are indicated by the values
54 of the following symbolic constants:
55
56 SCHED_FIFO First in-first out (FIFO) scheduling policy.
57
58 SCHED_RR Round robin scheduling policy.
59
60 SCHED_SPORADIC
61 Sporadic server scheduling policy.
62
63 SCHED_OTHER Another scheduling policy.
64
65 The values of these constants are distinct.
66
67 The following shall be declared as functions and may also be defined as
68 macros. Function prototypes shall be provided.
69
70 int sched_get_priority_max(int);
71 int sched_get_priority_min(int);
72 int sched_getparam(pid_t, struct sched_param *);
73 int sched_getscheduler(pid_t);
74 int sched_rr_get_interval(pid_t, struct timespec *);
75 int sched_setparam(pid_t, const struct sched_param *);
76 int sched_setscheduler(pid_t, int, const struct sched_param *);
77 int sched_yield(void);
78
79 Inclusion of the <sched.h> header may make visible all symbols from the
80 <time.h> header.
81
82 The following sections are informative.
83
85 None.
86
88 None.
89
91 None.
92
94 <sys_types.h>, <time.h>
95
96 The System Interfaces volume of POSIX.1‐2008, sched_get_priority_max(),
97 sched_getparam(), sched_getscheduler(), sched_rr_get_interval(),
98 sched_setparam(), sched_setscheduler(), sched_yield()
99
101 Portions of this text are reprinted and reproduced in electronic form
102 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
103 -- Portable Operating System Interface (POSIX), The Open Group Base
104 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
105 cal and Electronics Engineers, Inc and The Open Group. (This is
106 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
107 event of any discrepancy between this version and the original IEEE and
108 The Open Group Standard, the original IEEE and The Open Group Standard
109 is the referee document. The original Standard can be obtained online
110 at http://www.unix.org/online.html .
111
112 Any typographical or formatting errors that appear in this page are
113 most likely to have been introduced during the conversion of the source
114 files to man page format. To report such errors, see https://www.ker‐
115 nel.org/doc/man-pages/reporting_bugs.html .
116
117
118
119IEEE/The Open Group 2013 sched.h(0P)