Sharvin Neve 338bab40ec score: Fix TOD_LATEST_YEAR and watchdog overflow beyond 2400
rtems_clock_set() accepted years up to TOD_LATEST_YEAR defined as 4095.
However, realtime watchdogs represent timestamps using 34 bits for
seconds since the UNIX Epoch (WATCHDOG_MAX_SECONDS), which wraps around
year 2514. Setting CLOCK_REALTIME beyond year 2514 breaks every subsequent
tick: in debug builds _Watchdog_Ticks_from_timespec() asserts that the
timestamp is not far future, while in release builds the realtime watchdog
collection is tickled with wrapped values.

As discussed in the Year 4000 (Y4K) problem topic on the RTEMS forum,
extending the calendar to year 4095 is prevented by this 34-bit watchdog
seconds limit.

Furthermore, _TOD_Validate() checked year bounds while
_TOD_Is_valid_new_time_of_day() checked seconds against
TOD_SECONDS_1970_THROUGH_2400, leaving a boundary mismatch between
rtems_clock_set() and POSIX clock_settime().

Bound TOD_LATEST_YEAR to 2400 and align TOD_SECONDS_1970_THROUGH_2400
as an exclusive upper limit in _TOD_Is_valid_new_time_of_day(). Both
rtems_clock_set() and clock_settime() now consistently accept times up
to 2400-12-31T23:59:59.999999999Z and reject later values, leaving over
113 years of system uptime headroom before watchdog overflow. Synchronize
documentation and update psxclock, spclock_err02, and clock validation
test suites accordingly.

Closes #5749.
2026-09-29 03:34:07 +00:00
2026-09-28 09:48:59 +02:00
…
2026-09-28 09:48:59 +02:00
…
…
…
…

Real-Time Executive for Multiprocessing Systems

RTEMS is a real-time executive (kernel) which provides a high performance environment for embedded applications with the following features:

  • Standards based user interfaces.
  • Multitasking capabilities.
  • Homogeneous and heterogeneous multiprocessor systems.
  • Symmetric Multiprocessing (SMP):
    • Cluster scheduling: Job-level fixed prority scheduler (EDF) with support for one-to-one and one-to-all thread to processor affinities.
    • Locking protocols with transitive priority inheritance, priority ceiling, MRsP and OMIP.
  • Event-driven, priority-based, preemptive scheduling.
  • Scalable timer and timeout support.
  • Optional rate monotonic scheduling.
  • Intertask communication and synchronisation.
  • Priority inheritance.
  • Responsive interrupt management.
  • Dynamic memory allocation.
  • Dynamic code loading using run-time link editing.
  • File systems, IMFS, FAT, RFS, JFFS, NSFv4 (with LibBSD)
  • High level of user configurability.
  • Link-time configurable schedulers.
  • Linker-set based initialization (similar to global C++ constructors).
  • Drivers for I2C, SPI and LibBSD has NIC, USB, SD/MMC and Framebuffer.
  • Open source with a friendly user license.

RTEMS Project:

Project git repositories are located at:

Online documentation is available at:

RTEMS Doxygen for CPUKit:

RTEMS POSIX 1003.1 Compliance Guide:

RTEMS Discourse User forum for questions, answers and examples:

RTEMS Discord for support:

RTEMS Mailing Lists for general purpose use the users list and for developers use the devel list.

The version number for this software in releases is located in the VERSION file if present.

S
Description
RTEMS is a ​real-time executive in use by embedded systems applications around the world and beyond
Readme
150 MiB
Languages
C 93.9%
Assembly 3.4%
Ada 1.4%
Python 0.3%
HTML 0.3%
Other 0.4%