File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
libc/src/__support/OSUtil/linux Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,12 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
107107 }
108108
109109 // Attempt 2: read /proc/self/auxv.
110+ #ifdef SYS_openat
111+ int fd = syscall_impl<int >(SYS_openat, AT_FDCWD, " /proc/self/auxv" ,
112+ O_RDONLY | O_CLOEXEC);
113+ #else
110114 int fd = syscall_impl<int >(SYS_open, " /proc/self/auxv" , O_RDONLY | O_CLOEXEC);
115+ #endif
111116 if (fd < 0 ) {
112117 syscall_impl<long >(SYS_munmap, vector, AUXV_MMAP_SIZE);
113118 return ;
@@ -135,10 +140,9 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
135140
136141LIBC_INLINE cpp::optional<unsigned long > get (unsigned long type) {
137142 Vector auxvec;
138- for (const auto &entry : auxvec) {
143+ for (const auto &entry : auxvec)
139144 if (entry.type == type)
140145 return entry.val ;
141- }
142146 return cpp::nullopt ;
143147}
144148} // namespace auxv
You can’t perform that action at this time.
0 commit comments