summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/cond.c
diff options
context:
space:
mode:
authorMark Johannes <Mark.Johannes@OARcorp.com>1996-08-14 17:20:03 +0000
committerMark Johannes <Mark.Johannes@OARcorp.com>1996-08-14 17:20:03 +0000
commitaae1c9324a78d8477729d2c77d1460cf0025ffc0 (patch)
tree333d7e51a5765037e25436e1c4b3f5dbe0364db0 /cpukit/posix/src/cond.c
parentsystem.h: added task3 and changed condition variable config to 1 (diff)
downloadrtems-aae1c9324a78d8477729d2c77d1460cf0025ffc0.tar.bz2
pthread_cond_timedwait: added error cases for abstime
Diffstat (limited to 'cpukit/posix/src/cond.c')
-rw-r--r--cpukit/posix/src/cond.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c
index 25c175948f..4e87cf5c55 100644
--- a/cpukit/posix/src/cond.c
+++ b/cpukit/posix/src/cond.c
@@ -447,6 +447,17 @@ int pthread_cond_timedwait(
const struct timespec *abstime
)
{
+ if ( !abstime )
+ return EINVAL;
+
+/* XXX need to fully address an error occuring in the total timespec */
+
+ if ( abstime->tv_sec < 0 || abstime->tv_nsec < 0 )
+ return EINVAL;
+
+ if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
+ return EINVAL;
+
return _POSIX_Condition_variables_Wait_support(
cond,
mutex,