Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libc/src/__support/OSUtil/linux/auxv.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,17 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
}
size_t avaiable_size = AUXV_MMAP_SIZE - sizeof(Entry);

// Attempt 1: use PRCTL to get the auxv.
// We guarantee that the vector is always padded with AT_NULL entries.
// Attempt 1: use PRCTL to get the auxv.
// We guarantee that the vector is always padded with AT_NULL entries.
#ifdef PR_GET_AUXV
long prctl_ret = syscall_impl<long>(SYS_prctl, PR_GET_AUXV,
reinterpret_cast<unsigned long>(vector),
avaiable_size, 0, 0);
if (prctl_ret >= 0) {
entries = vector;
return;
}
#endif

// Attempt 2: read /proc/self/auxv.
#ifdef SYS_openat
Expand Down
Loading