Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 1 | From b15d8d0754bb545ba10d0cfba8bbfdfb22a62c38 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 20 Feb 2022 22:03:14 -0800 |
| 4 | Subject: [PATCH] futex: fix build on 32-bit architectures using 64-bit time_t |
| 5 | |
| 6 | Fix the following build failure on 32-bit architectures using 64-bit |
| 7 | time_t (e.g. riscv32): |
| 8 | | ./boost/fiber/detail/futex.hpp:31:23: error: use of undeclared identifier 'SYS_futex' |
| 9 | | return ::syscall( SYS_futex, addr, op, x, nullptr, nullptr, 0); |
| 10 | | ^ |
| 11 | | 1 error generated. |
| 12 | |
| 13 | Upstream-Status: Submitted [https://github.com/boostorg/fiber/pull/292] |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | --- |
| 16 | boost/fiber/detail/futex.hpp | 4 ++++ |
| 17 | 1 file changed, 4 insertions(+) |
| 18 | |
| 19 | diff --git a/boost/fiber/detail/futex.hpp b/boost/fiber/detail/futex.hpp |
| 20 | index e64bd5990..d0353e9e5 100644 |
| 21 | --- a/boost/fiber/detail/futex.hpp |
| 22 | +++ b/boost/fiber/detail/futex.hpp |
| 23 | @@ -12,6 +12,10 @@ |
| 24 | |
| 25 | #include <boost/fiber/detail/config.hpp> |
| 26 | |
| 27 | +#ifndef SYS_futex |
| 28 | +#define SYS_futex SYS_futex_time64 |
| 29 | +#endif |
| 30 | + |
| 31 | #if BOOST_OS_LINUX |
| 32 | extern "C" { |
| 33 | #include <linux/futex.h> |
| 34 | -- |
| 35 | 2.35.1 |
| 36 | |