diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-05-31 19:01:26 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-05-31 19:01:26 +0000 |
commit | e72d995a80461203e99c812afc7e0b660ed341d7 (patch) | |
tree | 5c4a82abcc9572937906d87ef1885cd9ae6d1b0a /c/src/exec/posix/src/time.c | |
parent | commented out cancel handlers related items. (diff) | |
download | rtems-e72d995a80461203e99c812afc7e0b660ed341d7.tar.bz2 |
moved sleep() from psignal.c to unistd.c
implemented sigemptyset() sigfillset(), sigaddset(), sigdelset(), and
sigismember().
added checks for valid attribute values to some of the pthread_attr_t sets.
Diffstat (limited to 'c/src/exec/posix/src/time.c')
-rw-r--r-- | c/src/exec/posix/src/time.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c index 7397635786..f9e5ce835f 100644 --- a/c/src/exec/posix/src/time.c +++ b/c/src/exec/posix/src/time.c @@ -298,12 +298,15 @@ int nanosleep( { Watchdog_Interval ticks; + if ( rqtp->tv_nsec < 0 || rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { + errno = EINVAL; + return -1; + } + /* XXX this is interruptible by a posix signal */ /* XXX rmtp is the time remaining on the timer -- we do not support this */ -/* XXX rmtp may be NULL */ - ticks = _POSIX_Time_Spec_to_interval( rqtp ); _Thread_Disable_dispatch(); @@ -316,7 +319,12 @@ int nanosleep( ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); - return 0; /* XXX should account for signal/remaining */ + + if ( rmtp ) { + /* XXX calculate time remaining */ + } + + return 0; /* XXX should account for signal */ } |