mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 21:35:30 +08:00
pthread_cond_timedwait: added error cases for abstime
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user