1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "<sched.h>" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
5 sched.h \- execution scheduling (\fBREALTIME\fP)
8 \fB#include <sched.h> \fP
11 The \fI<sched.h>\fP header shall define the \fBsched_param\fP structure,
12 which contains the scheduling parameters
13 required for implementation of each supported scheduling policy. This
14 structure shall contain at least the following member:
19 \fBint sched_priority \fP Process execution scheduling priority. \fB
24 In addition, if _POSIX_SPORADIC_SERVER or _POSIX_THREAD_SPORADIC_SERVER
25 is defined, the \fBsched_param\fP structure defined in
26 \fI<sched.h>\fP shall contain the following members in addition to
27 those specified above:
32 \fBint sched_ss_low_priority\fP Low scheduling priority for \fB
33 \fP sporadic server. \fB
34 struct timespec sched_ss_repl_period \fP Replenishment period for \fB
35 \fP sporadic server. \fB
36 struct timespec sched_ss_init_budget \fP Initial budget for sporadic server. \fB
37 int sched_ss_max_repl \fP Maximum pending replenishments for \fB
38 \fP sporadic server. \fB
43 Each process is controlled by an associated scheduling policy and
44 priority. Associated with each policy is a priority range.
45 Each policy definition specifies the minimum priority range for that
46 policy. The priority ranges for each policy may overlap the
47 priority ranges of other policies.
49 Four scheduling policies are defined; others may be defined by the
50 implementation. The four standard policies are indicated by
51 the values of the following symbolic constants:
54 First in-first out (FIFO) scheduling policy.
57 Round robin scheduling policy.
60 Sporadic server scheduling policy.
63 Another scheduling policy.
66 The values of these constants are distinct.
68 The following shall be declared as functions and may also be defined
69 as macros. Function prototypes shall be provided.
75 int sched_get_priority_max(int);
76 int sched_get_priority_min(int);
78 int sched_getparam(pid_t, struct sched_param *);
79 int sched_getscheduler(pid_t);
81 int sched_rr_get_interval(pid_t, struct timespec *);
83 int sched_setparam(pid_t, const struct sched_param *);
84 int sched_setscheduler(pid_t, int, const struct sched_param *);
86 int sched_yield(void);
93 Inclusion of the \fI<sched.h>\fP header may make visible all symbols
94 from the \fI<time.h>\fP header.
96 \fIThe following sections are informative.\fP
103 .SH FUTURE DIRECTIONS
110 Portions of this text are reprinted and reproduced in electronic form
111 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
112 -- Portable Operating System Interface (POSIX), The Open Group Base
113 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
114 Electrical and Electronics Engineers, Inc and The Open Group. In the
115 event of any discrepancy between this version and the original IEEE and
116 The Open Group Standard, the original IEEE and The Open Group Standard
117 is the referee document. The original Standard can be obtained online at
118 http://www.opengroup.org/unix/online.html .