Skip to contentSkip to conversation

y2038: lib/cobalt/mqueue: dispatch mq_timedreceive

PATCH New Song Chen 1 participant 1 message Jun 8, 2021

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH 4/5 y2038: lib/cobalt/mqueue: dispatch mq_timedreceive

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

otherwise, go to original mq_timedreceive.

---
 lib/cobalt/mq.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/cobalt/mq.c +5 -0
index 59e46f2..a8c88b4 100644
@@ -521,8 +521,13 @@ COBALT_IMPL(ssize_t, mq_timedreceive, (mqd_t q,
 
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
 
+#ifdef __USE_TIME_BITS64
+	err = XENOMAI_SYSCALL5(sc_cobalt_mq_timedreceive64,
+			       q, buffer, &rlen, prio, timeout);
+#else
 	err = XENOMAI_SYSCALL5(sc_cobalt_mq_timedreceive,
 			       q, buffer, &rlen, prio, timeout);
+#endif
 
 	pthread_setcanceltype(oldtype, NULL);
 
Signature · 1 line
2.7.4