* timer.cc (nanosleep): Treat tv_sec < 0 as invalid.

* include/search.h: Make declarations consistent with newlib.
This commit is contained in:
Christopher Faylor
2005-03-27 02:31:33 +00:00
parent ec98d19a08
commit 255557f8c3
3 changed files with 22 additions and 6 deletions

View File

@ -77,6 +77,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
pthread_testcancel ();
if ((unsigned int) rqtp->tv_sec > (HIRES_DELAY_MAX / 1000 - 1)
|| rqtp->tv_sec < 0
|| (unsigned int) rqtp->tv_nsec > 999999999)
{
set_errno (EINVAL);