1 | /** |
---|
2 | * @file sched.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * COPYRIGHT (c) 1989-2007. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | * $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | |
---|
17 | #ifndef _SCHED_H |
---|
18 | #define _SCHED_H |
---|
19 | |
---|
20 | #ifdef __cplusplus |
---|
21 | extern "C" { |
---|
22 | #endif |
---|
23 | |
---|
24 | #include <unistd.h> |
---|
25 | |
---|
26 | #if defined(_POSIX_PRIORITY_SCHEDULING) |
---|
27 | |
---|
28 | #include <sys/types.h> |
---|
29 | #include <time.h> |
---|
30 | #include <sys/sched.h> |
---|
31 | #include <pthread.h> |
---|
32 | |
---|
33 | /* |
---|
34 | * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 |
---|
35 | * |
---|
36 | */ |
---|
37 | |
---|
38 | int sched_setparam( |
---|
39 | pid_t pid, |
---|
40 | const struct sched_param *param |
---|
41 | ); |
---|
42 | |
---|
43 | /* |
---|
44 | * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 |
---|
45 | */ |
---|
46 | |
---|
47 | int sched_getparam( |
---|
48 | pid_t pid, |
---|
49 | struct sched_param *param |
---|
50 | ); |
---|
51 | |
---|
52 | /* |
---|
53 | * 13.3.3 Set Scheduling Policy and Scheduling Parameters, |
---|
54 | * P1003.1b-1993, p. 254 |
---|
55 | */ |
---|
56 | |
---|
57 | int sched_setscheduler( |
---|
58 | pid_t pid, |
---|
59 | int policy, |
---|
60 | const struct sched_param *param |
---|
61 | ); |
---|
62 | |
---|
63 | /* |
---|
64 | * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 |
---|
65 | */ |
---|
66 | |
---|
67 | int sched_getscheduler( |
---|
68 | pid_t pid |
---|
69 | ); |
---|
70 | |
---|
71 | /* |
---|
72 | * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 |
---|
73 | */ |
---|
74 | |
---|
75 | int sched_get_priority_max( |
---|
76 | int policy |
---|
77 | ); |
---|
78 | |
---|
79 | int sched_get_priority_min( |
---|
80 | int policy |
---|
81 | ); |
---|
82 | |
---|
83 | int sched_rr_get_interval( |
---|
84 | pid_t pid, |
---|
85 | struct timespec *interval |
---|
86 | ); |
---|
87 | |
---|
88 | #endif /* _POSIX_PRIORITY_SCHEDULING */ |
---|
89 | |
---|
90 | #if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING) |
---|
91 | |
---|
92 | /* |
---|
93 | * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 |
---|
94 | */ |
---|
95 | |
---|
96 | int sched_yield( void ); |
---|
97 | |
---|
98 | #endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ |
---|
99 | |
---|
100 | #ifdef __cplusplus |
---|
101 | } |
---|
102 | #endif |
---|
103 | |
---|
104 | #endif |
---|
105 | /* end of include file */ |
---|