about summary refs log tree commit diff
path: root/absl/base/internal/direct_mmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal/direct_mmap.h')
-rw-r--r--absl/base/internal/direct_mmap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 5618867ba0c6..16accf096604 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -61,6 +61,10 @@ extern "C" void* __mmap2(void*, size_t, int, int, int, size_t);
 #endif
 #endif  // __BIONIC__
 
+#if defined(__NR_mmap2) && !defined(SYS_mmap2)
+#define SYS_mmap2 __NR_mmap2
+#endif
+
 namespace absl {
 ABSL_NAMESPACE_BEGIN
 namespace base_internal {
@@ -72,6 +76,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
 #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
     (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
     (defined(__PPC__) && !defined(__PPC64__)) ||                             \
+    (defined(__riscv) && __riscv_xlen == 32) ||                              \
     (defined(__s390__) && !defined(__s390x__))
   // On these architectures, implement mmap with mmap2.
   static int pagesize = 0;