This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 72837c8d2698fcb6a9750ad8aa8103831fc2273b Author: Xiang Xiao <[email protected]> AuthorDate: Sun May 3 15:54:26 2026 +0800 !apps: drop CONFIG_SYSTEM_TIME64 conditionals NuttX always uses a 64-bit system clock now (time_t/clock_t are always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef branches and Kconfig dependency. - examples/dronecan: drop SYSTEM_TIME64 dependency - examples/netlink_route: always use PRIx64 - netutils/netinit: always use the 1-hour LONG_TIME_SEC - netutils/ptpd: always pack the 48-bit seconds field and apply the 64-bit overflow guard in timespec_delta_ns() - testing/ostest/semtimed: always validate tv_sec >= 0 Signed-off-by: Xiang Xiao <[email protected]> --- examples/dronecan/Kconfig | 2 +- examples/netlink_route/netlink_route_main.c | 4 ---- netutils/netinit/netinit.c | 6 +----- netutils/ptpd/ptpd.c | 7 ------- testing/ostest/semtimed.c | 4 ---- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/examples/dronecan/Kconfig b/examples/dronecan/Kconfig index f005a37f2..4ad761eb1 100644 --- a/examples/dronecan/Kconfig +++ b/examples/dronecan/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_DRONECAN tristate "DroneCAN example" default n - depends on CANUTILS_LIBDRONECAN && SYSTEM_TIME64 + depends on CANUTILS_LIBDRONECAN ---help--- Enable the LIBDRONECAN example diff --git a/examples/netlink_route/netlink_route_main.c b/examples/netlink_route/netlink_route_main.c index c69f4dd12..896a9796e 100644 --- a/examples/netlink_route/netlink_route_main.c +++ b/examples/netlink_route/netlink_route_main.c @@ -168,11 +168,7 @@ static void dump_neighbor(void) printf(" "); } -#ifdef CONFIG_SYSTEM_TIME64 printf("Time 0x%" PRIx64 "\n", nb->ne_time); -#else - printf("Time 0x%" PRIx32 "\n", nb->ne_time); -#endif } free(nbtab); diff --git a/netutils/netinit/netinit.c b/netutils/netinit/netinit.c index 24feea642..6120f4a67 100644 --- a/netutils/netinit/netinit.c +++ b/netutils/netinit/netinit.c @@ -204,11 +204,7 @@ * signal indicating a change in network status. */ -#ifdef CONFIG_SYSTEM_TIME64 -# define LONG_TIME_SEC (60*60) /* One hour in seconds */ -#else -# define LONG_TIME_SEC (5*60) /* Five minutes in seconds */ -#endif +#define LONG_TIME_SEC (60*60) /* One hour in seconds */ #define SHORT_TIME_SEC (2) /* 2 seconds */ diff --git a/netutils/ptpd/ptpd.c b/netutils/ptpd/ptpd.c index 74b43084d..430693cc9 100644 --- a/netutils/ptpd/ptpd.c +++ b/netutils/ptpd/ptpd.c @@ -184,13 +184,8 @@ static void timespec_to_ptp_format(FAR const struct timespec *ts, * both fields big-endian. */ -#ifdef CONFIG_SYSTEM_TIME64 timestamp[0] = (uint8_t)(ts->tv_sec >> 40); timestamp[1] = (uint8_t)(ts->tv_sec >> 32); -#else - timestamp[0] = 0; - timestamp[1] = 0; -#endif timestamp[2] = (uint8_t)(ts->tv_sec >> 24); timestamp[3] = (uint8_t)(ts->tv_sec >> 16); timestamp[4] = (uint8_t)(ts->tv_sec >> 8); @@ -320,7 +315,6 @@ static int64_t timespec_delta_ns(FAR const struct timespec *ts1, delta_s = ts1->tv_sec - ts2->tv_sec; -#ifdef CONFIG_SYSTEM_TIME64 /* Conversion to nanoseconds could overflow if the system time is 64-bit */ if (delta_s >= INT64_MAX / NSEC_PER_SEC) @@ -331,7 +325,6 @@ static int64_t timespec_delta_ns(FAR const struct timespec *ts1, { return INT64_MIN; } -#endif return delta_s * NSEC_PER_SEC + (ts1->tv_nsec - ts2->tv_nsec); } diff --git a/testing/ostest/semtimed.c b/testing/ostest/semtimed.c index ce3f163c1..2b8fc6648 100644 --- a/testing/ostest/semtimed.c +++ b/testing/ostest/semtimed.c @@ -79,11 +79,7 @@ static void ostest_gettime(struct timespec *tp) printf("ostest_gettime: ERROR: clock_gettime failed\n"); ASSERT(false); } -#ifdef CONFIG_SYSTEM_TIME64 else if (tp->tv_sec < 0 || tp->tv_nsec < 0 || -#else - else if (tp->tv_nsec < 0 || -#endif tp->tv_nsec >= 1000 * 1000 * 1000) { printf("ostest_gettime: ERROR: clock_gettime returned bogus time\n");
