summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/__gettod.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/__gettod.c')
-rw-r--r--cpukit/libcsupport/src/__gettod.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index 5dcd6073e8..d987637d39 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -28,16 +28,6 @@
#include <time.h>
#include <errno.h>
-#include <assert.h>
-
-/*
- * Seconds from January 1, 1970 to January 1, 1988. Used to account for
- * differences between POSIX API and RTEMS core.
- */
-
-#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
- (((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
- (4 * TOD_SECONDS_PER_DAY))
/*
* NOTE: The solaris gettimeofday does not have a second parameter.
@@ -48,10 +38,6 @@ int gettimeofday(
struct timezone *tzp
)
{
- rtems_interrupt_level level;
- uint32_t seconds;
- uint32_t microseconds;
-
if ( !tp ) {
errno = EFAULT;
return -1;
@@ -60,17 +46,9 @@ int gettimeofday(
/*
* POSIX does not seem to allow for not having a TOD so we just
* grab the time of day.
- *
- * NOTE: XXX this routine should really be in the executive proper.
*/
- rtems_interrupt_disable(level);
- seconds = _TOD_Seconds_since_epoch;
- microseconds = _TOD_Current.ticks;
- rtems_interrupt_enable(level);
-
- tp->tv_sec = seconds + POSIX_TIME_SECONDS_1970_THROUGH_1988;
- tp->tv_usec = microseconds * _TOD_Microseconds_per_tick;
+ _TOD_Get_timeval( tp );
/*
* Timezone information ignored by the OS proper. Per email