Skip to contentSkip to conversation

y2038: lib/cobalt/internal: dispatch event_wait

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

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH 2/3 y2038: lib/cobalt/internal: dispatch event_wait

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

otherwise, go to original event_wait.

---
 lib/cobalt/internal.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
lib/cobalt/internal.c +6 -1
index eadb064..ef3f163 100644
@@ -482,8 +482,13 @@ int cobalt_event_wait(cobalt_event_t *event,
 
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
 
+#ifdef __USE_TIME_BITS64
+	ret = XENOMAI_SYSCALL5(sc_cobalt_event_wait64,
+			       event, bits, bits_r, mode, timeout);
+#else
 	ret = XENOMAI_SYSCALL5(sc_cobalt_event_wait,
 			       event, bits, bits_r, mode, timeout);
+#endif
 
 	pthread_setcanceltype(oldtype, NULL);
 
@@ -579,4 +584,4 @@ void cobalt_features_init(struct cobalt_featinfo *f)
 
 	/* Trigger arch specific feature initialization */
 	cobalt_arch_check_features(f);
-}
\ No newline at end of file
+}
Signature · 1 line
2.7.4