source: rtems/cpukit/posix/src/sched.c @ 782bdfd

4.104.114.84.95
Last change on this file since 782bdfd was 782bdfd, checked in by Joel Sherrill <joel.sherrill@…>, on 06/06/96 at 19:09:27

Removed assert's from routines which return the error ENOSYS.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <assert.h>
6#include <sched.h>
7#include <errno.h>
8
9#include <rtems/system.h>
10#include <rtems/score/tod.h>
11#include <rtems/score/thread.h>
12#include <rtems/posix/priority.h>
13#include <rtems/posix/time.h>
14
15/*PAGE
16 *
17 *  13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
18 *
19 */
20
21int sched_setparam(
22  pid_t                     pid,
23  const struct sched_param *param
24)
25{
26  errno = ENOSYS;
27  return -1;
28}
29
30/*PAGE
31 *
32 *  13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253
33 */
34
35int sched_getparam(
36  pid_t                     pid,
37  const struct sched_param *param
38)
39{
40  errno = ENOSYS;
41  return -1;
42}
43
44/*PAGE
45 *
46 *  13.3.3 Set Scheduling Policy and Scheduling Parameters,
47 *         P1003.1b-1993, p. 254
48 */
49
50int sched_setscheduler(
51  pid_t                     pid,
52  int                       policy,
53  const struct sched_param *param
54)
55{
56  errno = ENOSYS;
57  return -1;
58}
59
60/*PAGE
61 *
62 *  13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256
63 */
64
65int sched_getscheduler(
66  pid_t                     pid
67)
68{
69  errno = ENOSYS;
70  return -1;
71}
72
73/*PAGE
74 *
75 *  13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
76 */
77
78int sched_get_priority_max(
79  int  policy
80)
81{
82  switch ( policy ) {
83    case SCHED_OTHER:
84    case SCHED_FIFO:
85    case SCHED_RR:
86    case SCHED_SPORADIC:
87      break;
88 
89    default:
90      errno = EINVAL;
91      return -1;
92  }
93
94  return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
95}
96
97/*PAGE
98 *
99 *  13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
100 */
101
102int sched_get_priority_min(
103  int  policy
104)
105{
106  switch ( policy ) {
107    case SCHED_OTHER:
108    case SCHED_FIFO:
109    case SCHED_RR:
110    case SCHED_SPORADIC:
111      break;
112 
113    default:
114      errno = EINVAL;
115      return -1;
116  }
117
118  return POSIX_SCHEDULER_MINIMUM_PRIORITY;
119}
120
121/*PAGE
122 *
123 *  13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
124 */
125
126int sched_rr_get_interval(
127  pid_t             pid,
128  struct timespec  *interval
129)
130{
131  /* XXX do we need to support different time quantums per thread */
132
133  /*
134   *  Only supported for the "calling process" (i.e. this node).
135   */
136
137  assert( pid == getpid() );
138
139  _POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval );
140  return 0;
141}
142
143/*PAGE
144 *
145 *  13.3.5 Yield Processor, P1003.1b-1993, p. 257
146 */
147
148int sched_yield( void )
149{
150  _Thread_Yield_processor();
151  return 0;
152}
Note: See TracBrowser for help on using the repository browser.