summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/include/rtems/score/todimpl.h9
-rw-r--r--cpukit/score/src/coretodcheck.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/todimpl.h b/cpukit/include/rtems/score/todimpl.h
index ceeef2e21b..f85689fd9c 100644
--- a/cpukit/include/rtems/score/todimpl.h
+++ b/cpukit/include/rtems/score/todimpl.h
@@ -116,6 +116,15 @@ extern "C" {
(4 * TOD_SECONDS_PER_DAY))
/**
+ * @brief Seconds from 1970-01-01T00:00:00Z to 2400-01-01T00:00:00Z.
+ *
+ * This is the latest time of day which should be set by _TOD_Set(). The year
+ * 2400 was chosen to guarantee a defined CLOCK_REALTIME within the range of a
+ * system uptime of about 114 years.
+ */
+#define TOD_SECONDS_1970_THROUGH_2400 13569465600
+
+/**
* @brief Earliest year to which an time of day can be initialized.
*
* The following constant define the earliest year to which an
diff --git a/cpukit/score/src/coretodcheck.c b/cpukit/score/src/coretodcheck.c
index b42435aa43..8c012c5070 100644
--- a/cpukit/score/src/coretodcheck.c
+++ b/cpukit/score/src/coretodcheck.c
@@ -51,7 +51,7 @@ Status_Control _TOD_Is_valid_new_time_of_day( const struct timespec *tod )
return STATUS_INVALID_NUMBER;
}
- if ( _Watchdog_Is_far_future_timespec( tod ) ) {
+ if ( tod->tv_sec > TOD_SECONDS_1970_THROUGH_2400 ) {
return STATUS_INVALID_NUMBER;
}