Skip to contentSkip to conversation

y2038: lib/cobalt/clock: dispatch clock_getres

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

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH 2/3 y2038: lib/cobalt/clock: dispatch clock_getres

From: chensong <[email protected]>

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

otherwise, go to original clock_getres.

---
 lib/cobalt/clock.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/cobalt/clock.c +5 -0
index 45593ed..3045563 100644
@@ -101,7 +101,12 @@ COBALT_IMPL(int, clock_getres, (clockid_t clock_id, struct timespec *tp))
 {
 	int ret;
 
+#ifdef __USE_TIME_BITS64
+	ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_getres64, clock_id, tp);
+#else
 	ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_getres, clock_id, tp);
+#endif
+
 	if (ret) {
 		errno = ret;
 		return -1;
Signature · 1 line
2.7.4