diff options
author | Mark Johannes <Mark.Johannes@OARcorp.com> | 1996-08-14 17:20:03 +0000 |
---|---|---|
committer | Mark Johannes <Mark.Johannes@OARcorp.com> | 1996-08-14 17:20:03 +0000 |
commit | aae1c9324a78d8477729d2c77d1460cf0025ffc0 (patch) | |
tree | 333d7e51a5765037e25436e1c4b3f5dbe0364db0 /c/src/exec/posix/src/cond.c | |
parent | system.h: added task3 and changed condition variable config to 1 (diff) | |
download | rtems-aae1c9324a78d8477729d2c77d1460cf0025ffc0.tar.bz2 |
pthread_cond_timedwait: added error cases for abstime
Diffstat (limited to 'c/src/exec/posix/src/cond.c')
-rw-r--r-- | c/src/exec/posix/src/cond.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/c/src/exec/posix/src/cond.c b/c/src/exec/posix/src/cond.c index 25c175948f..4e87cf5c55 100644 --- a/c/src/exec/posix/src/cond.c +++ b/c/src/exec/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, |