Skip to contentSkip to conversation

y2038: lib/cobalt/clock: dispatch clock_settime

PATCH In review Song Chen 1 participant 1 message Apr 21, 2021

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH v5 3/5 y2038: lib/cobalt/clock: dispatch clock_settime

From: chensong <[email protected]>

If sizeof time_t bigger than 4, which means glibc supports 64bit timespec, go to clock_settime64.

otherwise, go to original clock_settime.

---
 lib/cobalt/clock.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/cobalt/clock.c +4 -0
index 8f06320..edd640b 100644
@@ -276,7 +276,11 @@ COBALT_IMPL(int, clock_settime, (clockid_t clock_id, const struct timespec *tp))
 	if (clock_id == CLOCK_REALTIME && !cobalt_use_legacy_tsc())
 		return __STD(clock_settime(CLOCK_REALTIME, tp));
 
+#ifdef __USE_TIME_BITS64
+	ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_settime64, clock_id, tp);
+#else
 	ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_settime, clock_id, tp);
+#endif
 	if (ret) {
 		errno = ret;
 		return -1;
Signature · 1 line
2.7.4