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

otherwise, go to original mq_timedreceive.

Signed-off-by: Song Chen <[email protected]>
---
 lib/cobalt/mq.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/cobalt/mq.c b/lib/cobalt/mq.c
index 59e46f2..a8c88b4 100644
--- a/lib/cobalt/mq.c
+++ b/lib/cobalt/mq.c
@@ -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);
 
-- 
2.7.4


Reply via email to