1From d611f78198dee64bb6a05933d200b544e2510b76 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Sat, 14 Nov 2020 14:37:13 -0800 4Subject: [PATCH] innobase: Define __NR_futex if it does not exist 5 6__NR_futex is not defines by newer architectures e.g. arc, riscv32 as 7they only have 64bit variant of time_t. Glibc defines SYS_futex interface based 8on 9__NR_futex, since this is used in applications, such applications start 10to fail to build for these newer architectures. This patch defines a 11fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps 12working 13 14Upstream-Status: Pending 15 16Signed-off-by: Khem Raj <raj.khem@gmail.com> 17--- 18 storage/innobase/log/log0sync.cc | 3 +++ 19 1 file changed, 3 insertions(+) 20 21diff --git a/storage/innobase/log/log0sync.cc b/storage/innobase/log/log0sync.cc 22index 7799e605..4fab8f74 100644 23--- a/storage/innobase/log/log0sync.cc 24+++ b/storage/innobase/log/log0sync.cc 25@@ -66,6 +66,9 @@ Note that if write operation is very fast, a) or b) can be fine as alternative. 26 #ifdef __linux__ 27 #include <linux/futex.h> 28 #include <sys/syscall.h> 29+#if !defined(SYS_futex) && defined(SYS_futex_time64) 30+# define SYS_futex SYS_futex_time64 31+#endif 32 #endif 33 34 #include <atomic> 35-- 362.29.2 37 38