Skip to contentSkip to conversation

y2038: lib/cobalt/mutex: dispatch mutex_timedlock

PATCH Superseded Song Chen 1 participant 1 message Jun 3, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Song Chen

author
#0 lore raw

PATCH v2 2/3 y2038: lib/cobalt/mutex: dispatch mutex_timedlock

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

otherwise, go to original mutex_timedlock.

---
 lib/cobalt/mutex.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/cobalt/mutex.c +4 -0
index 29236c7..73e45a1 100644
@@ -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)
Signature · 1 line
2.7.4