summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-03 16:29:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-03 16:29:35 +0000
commita38283590c8d4cb578378f61fab34038258eed38 (patch)
treef00d7b81a2dda1c41ebd6f4f18aaa1457d78f4e9 /c/src
parentchanged so this file is usable from assembly files. (diff)
downloadrtems-a38283590c8d4cb578378f61fab34038258eed38.tar.bz2
added constant for seconds between posix epoch (1970) and rtems epoch (1988).
Formerly this constant was in the file src/time.c.
Diffstat (limited to 'c/src')
-rw-r--r--c/src/exec/posix/headers/time.h11
-rw-r--r--c/src/exec/posix/include/rtems/posix/time.h11
2 files changed, 22 insertions, 0 deletions
diff --git a/c/src/exec/posix/headers/time.h b/c/src/exec/posix/headers/time.h
index 0b11f2fa54..eb48d2af5d 100644
--- a/c/src/exec/posix/headers/time.h
+++ b/c/src/exec/posix/headers/time.h
@@ -7,6 +7,17 @@
#ifndef __RTEMS_POSIX_TIME_h
#define __RTEMS_POSIX_TIME_h
+#include <rtems/score/tod.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))
+
Watchdog_Interval _POSIX_Time_Spec_to_interval(
const struct timespec *time
);
diff --git a/c/src/exec/posix/include/rtems/posix/time.h b/c/src/exec/posix/include/rtems/posix/time.h
index 0b11f2fa54..eb48d2af5d 100644
--- a/c/src/exec/posix/include/rtems/posix/time.h
+++ b/c/src/exec/posix/include/rtems/posix/time.h
@@ -7,6 +7,17 @@
#ifndef __RTEMS_POSIX_TIME_h
#define __RTEMS_POSIX_TIME_h
+#include <rtems/score/tod.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))
+
Watchdog_Interval _POSIX_Time_Spec_to_interval(
const struct timespec *time
);