Browse Source

add namespace-safe version of getauxval for internal use

Rich Felker 6 years ago
parent
commit
26c66c485c
2 changed files with 13 additions and 1 deletions
  1. 10 0
      src/include/sys/auxv.h
  2. 3 1
      src/misc/getauxval.c

+ 10 - 0
src/include/sys/auxv.h

@@ -0,0 +1,10 @@
+#ifndef SYS_AUXV_H
+#define SYS_AUXV_H
+
+#include "../../../include/sys/auxv.h"
+
+#include <features.h>
+
+hidden unsigned long __getauxval(unsigned long);
+
+#endif

+ 3 - 1
src/misc/getauxval.c

@@ -2,7 +2,7 @@
 #include <errno.h>
 #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);