History

aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support elf_aux_info(3).

Brad Smith committed 2 years ago

Commit a3f79fd1 parent 1709f383 files · +11 −2Browse files

Unified · Split

3 files
  1. configure +2 −0
  2. libavutil/aarch64/cpu.c +1 −1
  3. libavutil/cpu.c +8 −1
configure+2−0
@@ -2367,6 +2367,7 @@ SYSTEM_FUNCS=" · 2366 unmodified lines
23672367 clock_gettime
23682368 closesocket
23692369 CommandLineToArgvW
2370+ elf_aux_info
23702371 fcntl
23712372 getaddrinfo
23722373 getauxval
@@ -6579,6 +6580,7 @@ check_func_headers mach/mach_time.h mach_absolute_time · 4206 unmodified lines
65796580 check_func_headers stdlib.h getenv
65806581 check_func_headers sys/stat.h lstat
65816582 check_func_headers sys/auxv.h getauxval
6583+check_func_headers sys/auxv.h elf_aux_info
65826584 check_func_headers sys/sysctl.h sysctlbyname
65836585
65846586 check_func_headers windows.h GetModuleHandle
libavutil/aarch64/cpu.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include "libavutil/cpu_internal.h"
2121 #include "config.h"
2222
23−#if (defined(__linux__) || defined(__ANDROID__)) && HAVE_GETAUXVAL
23+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
2424 #include <stdint.h>
2525 #include <sys/auxv.h>
2626
libavutil/cpu.c+8−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #include <unistd.h>
5050 #endif
5151
52−#if HAVE_GETAUXVAL
52+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
5353 #include <sys/auxv.h>
5454 #endif
5555
@@ -292,6 +292,13 @@ unsigned long ff_getauxval(unsigned long type) · 236 unmodified lines
292292 {
293293 #if HAVE_GETAUXVAL
294294 return getauxval(type);
295+#elif HAVE_ELF_AUX_INFO
296+ unsigned long aux = 0;
297+ int ret = elf_aux_info(type, &aux, sizeof(aux));
298+ if (ret != 0) {
299+ errno = ret;
300+ }
301+ return aux;
295302 #else
296303 errno = ENOSYS;
297304 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t