summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxtimer01
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/psxtimer01
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/psxtimer01')
-rw-r--r--testsuites/psxtests/psxtimer01/psxtimer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/testsuites/psxtests/psxtimer01/psxtimer.c b/testsuites/psxtests/psxtimer01/psxtimer.c
index 0a36b24aa8..0ac1fbe8cc 100644
--- a/testsuites/psxtests/psxtimer01/psxtimer.c
+++ b/testsuites/psxtests/psxtimer01/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.
@@ -135,6 +138,7 @@ void * task_a (void *arg)
void * task_b (void *arg)
{
struct timespec my_period;
+ struct timespec now;
int my_sig, received_sig;
struct itimerspec timerdata;
timer_t timer_id;
@@ -162,9 +166,10 @@ void * task_b (void *arg)
pthread_sigmask(SIG_BLOCK,&set,NULL);
/* set the timer in periodic mode */
+ clock_gettime( CLOCK_REALTIME, &now );
timerdata.it_interval = my_period;
- timerdata.it_value = _TOD_Now;
- _Timespec_Add_to( &timerdata.it_value, &my_period);
+ timerdata.it_value = now;
+ _Timespec_Add_to( &timerdata.it_value, &my_period );
if (timer_settime(timer_id,TIMER_ABSTIME,&timerdata,NULL) == -1) {
perror ("Error in timer setting\n");
pthread_exit ((void *) -1);