summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/psxtransschedparam.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-01 21:49:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-01 21:49:40 +0000
commit770db692bc379595785a11a8cd4543daa360286c (patch)
tree112ea5515c6cb5a9f1d712f674e9e288a58ade11 /cpukit/posix/src/psxtransschedparam.c
parent2009-08-01 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-770db692bc379595785a11a8cd4543daa360286c.tar.bz2
2009-08-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/src/psxtransschedparam.c, posix/src/pthread.c: Add error checks for 0 time on sporadic scheduler replenish period and initial budget. This avoids having to correct for it in the TSR, so we can eliminate the check for ticks == 0 there.
Diffstat (limited to 'cpukit/posix/src/psxtransschedparam.c')
-rw-r--r--cpukit/posix/src/psxtransschedparam.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/posix/src/psxtransschedparam.c b/cpukit/posix/src/psxtransschedparam.c
index 0940d67b5b..415e807d4c 100644
--- a/cpukit/posix/src/psxtransschedparam.c
+++ b/cpukit/posix/src/psxtransschedparam.c
@@ -49,6 +49,14 @@ int _POSIX_Thread_Translate_sched_param(
}
if ( policy == SCHED_SPORADIC ) {
+ if ( (param->ss_replenish_period.tv_sec == 0) &&
+ (param->ss_replenish_period.tv_nsec == 0) )
+ return EINVAL;
+
+ if ( (param->ss_initial_budget.tv_sec == 0) &&
+ (param->ss_initial_budget.tv_nsec == 0) )
+ return EINVAL;
+
if ( _Timespec_To_ticks( &param->ss_replenish_period ) <
_Timespec_To_ticks( &param->ss_initial_budget ) )
return EINVAL;