From 26c66c485c04fa782b8c6f7450bf008f4457b5a8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 9 Dec 2018 22:40:52 -0500 Subject: [PATCH] add namespace-safe version of getauxval for internal use --- src/include/sys/auxv.h | 10 ++++++++++ src/misc/getauxval.c | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/include/sys/auxv.h diff --git a/src/include/sys/auxv.h b/src/include/sys/auxv.h new file mode 100644 index 00000000..9358a4a5 --- /dev/null +++ b/src/include/sys/auxv.h @@ -0,0 +1,10 @@ +#ifndef SYS_AUXV_H +#define SYS_AUXV_H + +#include "../../../include/sys/auxv.h" + +#include + +hidden unsigned long __getauxval(unsigned long); + +#endif diff --git a/src/misc/getauxval.c b/src/misc/getauxval.c index b846c80f..57f21eed 100644 --- a/src/misc/getauxval.c +++ b/src/misc/getauxval.c @@ -2,7 +2,7 @@ #include #include "libc.h" -unsigned long getauxval(unsigned long item) +unsigned long __getauxval(unsigned long item) { size_t *auxv = libc.auxv; if (item == AT_SECURE) return libc.secure; @@ -11,3 +11,5 @@ unsigned long getauxval(unsigned long item) errno = ENOENT; return 0; } + +weak_alias(__getauxval, getauxval); -- 2.25.1