diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-06-03 18:59:59 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1996-06-03 18:59:59 +0000 |
commit | e984c64589d0cd92b57e2d8cfc806b3fe61a8efb (patch) | |
tree | 24280d3138ea58f52bdc1a1d2199aa3e9ed59138 /testsuites/psxtests/psx01/init.c | |
parent | sleep moved into newlibc.c so the sleep.o object would not be in the library. (diff) | |
download | rtems-e984c64589d0cd92b57e2d8cfc806b3fe61a8efb.tar.bz2 |
added test code for return of remaining time from sleep().
Diffstat (limited to 'testsuites/psxtests/psx01/init.c')
-rw-r--r-- | testsuites/psxtests/psx01/init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c index 28fe62622a..98fb6d41ac 100644 --- a/testsuites/psxtests/psx01/init.c +++ b/testsuites/psxtests/psx01/init.c @@ -51,6 +51,7 @@ void *POSIX_Init( int status; pthread_t thread_id; time_t seconds; + time_t remaining; struct tm tm; struct timespec tv; struct timespec tr; @@ -74,8 +75,8 @@ void *POSIX_Init( /* use sleep to delay */ - seconds = sleep( 3 ); - assert( !seconds ); + remaining = sleep( 3 ); + assert( !remaining ); /* print new times to make sure it has changed and we can get the realtime */ @@ -87,6 +88,11 @@ void *POSIX_Init( seconds = time( NULL ); printf( ctime( &seconds ) ); + /* check the time remaining */ + + printf( "seconds remaining (%d)\n", (int)remaining ); + assert( !remaining ); + /* use nanosleep to delay */ tv.tv_sec = 3; |