Skip to content

Commit b8fb034

Browse files
author
git apple-llvm automerger
committed
Merge commit '8c3d929f0e0e' from llvm.org/main into next
2 parents dbf2104 + 8c3d929 commit b8fb034

File tree

1 file changed

+4
-2
lines changed
  • libc/src/__support/OSUtil/linux

1 file changed

+4
-2
lines changed

libc/src/__support/OSUtil/linux/auxv.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,17 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
9696
}
9797
size_t avaiable_size = AUXV_MMAP_SIZE - sizeof(Entry);
9898

99-
// Attempt 1: use PRCTL to get the auxv.
100-
// We guarantee that the vector is always padded with AT_NULL entries.
99+
// Attempt 1: use PRCTL to get the auxv.
100+
// We guarantee that the vector is always padded with AT_NULL entries.
101+
#ifdef PR_GET_AUXV
101102
long prctl_ret = syscall_impl<long>(SYS_prctl, PR_GET_AUXV,
102103
reinterpret_cast<unsigned long>(vector),
103104
avaiable_size, 0, 0);
104105
if (prctl_ret >= 0) {
105106
entries = vector;
106107
return;
107108
}
109+
#endif
108110

109111
// Attempt 2: read /proc/self/auxv.
110112
#ifdef SYS_openat

0 commit comments

Comments
 (0)