[PATCH 2/3] y2038: lib/cobalt/mutex: dispatch mutex_timedlock

Song Chen chensong_2000 at 189.cn
Tue May 25 05:03:43 CEST 2021


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

otherwise, go to original mutex_timedlock.

Signed-off-by: Song Chen <chensong_2000 at 189.cn>
---
 lib/cobalt/mutex.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/cobalt/mutex.c b/lib/cobalt/mutex.c
index 29236c7..73e45a1 100644
--- a/lib/cobalt/mutex.c
+++ b/lib/cobalt/mutex.c
@@ -479,7 +479,11 @@ slow_path:
 	}
 
 	do {
+#ifdef __USE_TIME_BITS64
+		ret = XENOMAI_SYSCALL2(sc_cobalt_mutex_timedlock64, _mutex, to);
+#else
 		ret = XENOMAI_SYSCALL2(sc_cobalt_mutex_timedlock, _mutex, to);
+#endif
 	} while (ret == -EINTR);
 
 	if (ret == 0)
-- 
2.7.4




More information about the Xenomai mailing list