y2038: lib/cobalt/clock: dispatch clock_settime
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.
Signed-off-by chensong <[email protected]>
--- lib/cobalt/clock.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/cobalt/clock.c +4 -0
@@ -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