Skip to contentSkip to conversation

y2038: lib/cobalt/signal: dispatch sigtimedwait

PATCH New Song Chen 1 participant 1 message Jul 9, 2021

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH 2/3 y2038: lib/cobalt/signal: dispatch sigtimedwait

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

otherwise, go to original sigtimedwait.

---
 lib/cobalt/signal.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/cobalt/signal.c +4 -0
index 7e03301..40d315e 100644
@@ -62,7 +62,11 @@ COBALT_IMPL(int, sigtimedwait, (const sigset_t *set, siginfo_t *si,
 
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
 
+#ifdef __USE_TIME_BITS64
+	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait64, set, si, timeout);
+#else
 	ret = XENOMAI_SYSCALL3(sc_cobalt_sigtimedwait, set, si, timeout);
+#endif
 	if (ret < 0) {
 		errno = -ret;
 		ret = -1;
Signature · 1 line
2.7.4