--- a/libs/log/src/event.cpp
+++ b/libs/log/src/event.cpp
@@ -31,6 +31,10 @@
 #include <linux/futex.h>
 #include <boost/memory_order.hpp>
 
+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
+# define __NR_futex __NR_futex_time64
+#endif
+
 // Some Android NDKs (Google NDK and older Crystax.NET NDK versions) don't define SYS_futex
 #if defined(SYS_futex)
 #define BOOST_LOG_SYS_FUTEX SYS_futex
