nanosleep: verify rqtp parameter is non-NULL.

nanosleep: return 0 time remaining for a yield case.
This commit is contained in:
Joel Sherrill
1996-08-12 19:55:09 +00:00
parent c4f5e752e6
commit 5f08fd6179
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -247,6 +247,9 @@ int nanosleep(
{
Watchdog_Interval ticks;
if ( !rqtp )
set_errno_and_return_minus_one( EINVAL );
/*
* Return EAGAIN if the delay interval is negative.
*
@@ -272,6 +275,10 @@ int nanosleep(
if ( !ticks ) {
_Thread_Yield_processor();
_Thread_Dispatch();
if ( rmtp ) {
rmtp->tv_sec = 0;
rmtp->tv_nsec = 0;
}
return 0;
}
+7
View File
@@ -247,6 +247,9 @@ int nanosleep(
{
Watchdog_Interval ticks;
if ( !rqtp )
set_errno_and_return_minus_one( EINVAL );
/*
* Return EAGAIN if the delay interval is negative.
*
@@ -272,6 +275,10 @@ int nanosleep(
if ( !ticks ) {
_Thread_Yield_processor();
_Thread_Dispatch();
if ( rmtp ) {
rmtp->tv_sec = 0;
rmtp->tv_nsec = 0;
}
return 0;
}