We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33f2668 commit 1892e6fCopy full SHA for 1892e6f
libc/src/__support/OSUtil/linux/auxv.h
@@ -81,7 +81,12 @@ LIBC_INLINE void Vector::initialize_unsafe(const Entry *auxv) {
81
[[gnu::cold]]
82
LIBC_INLINE void Vector::fallback_initialize_unsync() {
83
constexpr size_t AUXV_MMAP_SIZE = FALLBACK_AUXV_ENTRIES * sizeof(Entry);
84
- long mmap_ret = syscall_impl<long>(SYS_mmap, nullptr, AUXV_MMAP_SIZE,
+#ifdef SYS_mmap2
85
+ constexpr int MMAP_SYSNO = SYS_mmap2;
86
+#else
87
+ constexpr int MMAP_SYSNO = SYS_mmap;
88
+#endif
89
+ long mmap_ret = syscall_impl<long>(MMAP_SYSNO, nullptr, AUXV_MMAP_SIZE,
90
PROT_READ | PROT_WRITE,
91
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
92
// We do not proceed if mmap fails.
0 commit comments