summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxtimer02
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-08 17:33:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-12-08 17:33:37 +0000
commitbdd1f5d1af8a7278316cc2598015f555daeb86a5 (patch)
tree5bb33e60d80292f298fc9c4f1fcb96bcb63b339d /testsuites/psxtests/psxtimer02
parent2008-12-08 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-bdd1f5d1af8a7278316cc2598015f555daeb86a5.tar.bz2
2008-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtimer01/psxtimer.c, psxtimer02/psxtimer.c: Obtain TOD with clock_gettime() NOT by reaching into the SuperCore.
Diffstat (limited to 'testsuites/psxtests/psxtimer02')
-rw-r--r--testsuites/psxtests/psxtimer02/psxtimer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/testsuites/psxtests/psxtimer02/psxtimer.c b/testsuites/psxtests/psxtimer02/psxtimer.c
index 9a97e5ccdf..22355387c7 100644
--- a/testsuites/psxtests/psxtimer02/psxtimer.c
+++ b/testsuites/psxtests/psxtimer02/psxtimer.c
@@ -12,6 +12,9 @@
*
* Other POSIX facilities such as timers, condition, .. is also used
*
+ * COPYRIGHT (c) 1989-2008.
+ * On-Line Applications Research Corporation (OAR).
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
@@ -32,6 +35,7 @@ void *POSIX_Init (
)
{
+ struct timespec now;
struct sigevent event;
int status;
timer_t timer;
@@ -92,7 +96,8 @@ void *POSIX_Init (
status = timer_settime( timer, TIMER_ABSTIME, &itimer, NULL );
fatal_posix_service_status_errno( status, EINVAL, "bad itimer value #2" );
- itimer.it_value = _TOD_Now;
+ clock_gettime( CLOCK_REALTIME, &now );
+ itimer.it_value = now;
itimer.it_value.tv_sec = itimer.it_value.tv_sec - 1;
puts( "timer_settime - bad itimer value - previous time - EINVAL" );
status = timer_settime( timer, TIMER_ABSTIME, &itimer, NULL );