Skip to contentSkip to conversation

y2038: lib/cobalt/internal: dispatch monitor_wait

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

lore
Share & tools
lore

Song Chen

author
#0 lore raw

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

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

otherwise, go to original monitor_wait.

---
 lib/cobalt/internal.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/cobalt/internal.c +5 -0
index bc3287b..ef3f163 100644
@@ -256,8 +256,13 @@ int cobalt_monitor_wait(cobalt_monitor_t *mon, int event,
 
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
 
+#ifdef __USE_TIME_BITS64
+	ret = XENOMAI_SYSCALL4(sc_cobalt_monitor_wait64,
+			       mon, event, ts, &opret);
+#else
 	ret = XENOMAI_SYSCALL4(sc_cobalt_monitor_wait,
 			       mon, event, ts, &opret);
+#endif
 
 	pthread_setcanceltype(oldtype, NULL);
 
Signature · 1 line
2.7.4