Changeset df8d1440 in rtems


Ignore:
Timestamp:
07/02/96 18:13:59 (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
729c8f2e
Parents:
e399e182
Message:

* empty log message *

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/time.c

    re399e182 rdf8d1440  
    240240  Watchdog_Interval ticks;
    241241
    242   if ( rqtp->tv_nsec < 0 || rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
     242  /*
     243   *  Return EAGAIN if the delay interval is negative. 
     244   *
     245   *  NOTE:  This behavior is beyond the POSIX specification. 
     246   *         FSU pthreads shares this behavior.
     247   */
     248
     249  if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
     250    set_errno_and_return_minus_one( EAGAIN );
     251
     252  if ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
    243253    set_errno_and_return_minus_one( EINVAL );
    244254 
     
    246256
    247257  ticks = _POSIX_Timespec_to_interval( rqtp );
     258
     259  /*
     260   *  This behavior is also beyond the POSIX specification but is
     261   *  consistent with the RTEMS api and yields desirable behavior.
     262   */
     263
     264  if ( !ticks ) {
     265    _Thread_Yield_processor();
     266    _Thread_Dispatch();
     267    return 0;
     268  }
    248269 
    249270  _Thread_Disable_dispatch();
  • cpukit/posix/src/time.c

    re399e182 rdf8d1440  
    240240  Watchdog_Interval ticks;
    241241
    242   if ( rqtp->tv_nsec < 0 || rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
     242  /*
     243   *  Return EAGAIN if the delay interval is negative. 
     244   *
     245   *  NOTE:  This behavior is beyond the POSIX specification. 
     246   *         FSU pthreads shares this behavior.
     247   */
     248
     249  if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 )
     250    set_errno_and_return_minus_one( EAGAIN );
     251
     252  if ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
    243253    set_errno_and_return_minus_one( EINVAL );
    244254 
     
    246256
    247257  ticks = _POSIX_Timespec_to_interval( rqtp );
     258
     259  /*
     260   *  This behavior is also beyond the POSIX specification but is
     261   *  consistent with the RTEMS api and yields desirable behavior.
     262   */
     263
     264  if ( !ticks ) {
     265    _Thread_Yield_processor();
     266    _Thread_Dispatch();
     267    return 0;
     268  }
    248269 
    249270  _Thread_Disable_dispatch();
Note: See TracChangeset for help on using the changeset viewer.