From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/misc/getauxval.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/misc/getauxval.c (limited to 'src/misc/getauxval.c') diff --git a/src/misc/getauxval.c b/src/misc/getauxval.c new file mode 100644 index 0000000..57f21ee --- /dev/null +++ b/src/misc/getauxval.c @@ -0,0 +1,15 @@ +#include +#include +#include "libc.h" + +unsigned long __getauxval(unsigned long item) +{ + size_t *auxv = libc.auxv; + if (item == AT_SECURE) return libc.secure; + for (; *auxv; auxv+=2) + if (*auxv==item) return auxv[1]; + errno = ENOENT; + return 0; +} + +weak_alias(__getauxval, getauxval); -- cgit v1.2.3