Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 1 | Use SYS_futex for syscall |
| 2 | |
| 3 | glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there |
| 4 | is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64 |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | Signed-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 { |