blob: 3277a3eee11ef35576ef973fa8cb2f7b3b60875d [file] [log] [blame]
Andrew Geisslere34f8962021-04-15 15:53:51 -05001 Use SYS_futex for syscall
2
3glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there
4is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64
5
6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8--- a/storage/innobase/include/ib0mutex.h
9+++ b/storage/innobase/include/ib0mutex.h
10@@ -150,6 +150,12 @@ private:
11 #include <linux/futex.h>
12 #include <sys/syscall.h>
13
14+/** Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and
15+ therefore do not define __NR_futex */
16+#if !defined(SYS_futex) && defined(SYS_futex_time64)
17+# define SYS_futex SYS_futex_time64
18+#endif
19+
20 /** Mutex implementation that used the Linux futex. */
21 template <template <typename> class Policy>
22 struct TTASFutexMutex {