1
0

getauxval.c 305 B

123456789101112131415
  1. #include <sys/auxv.h>
  2. #include <errno.h>
  3. #include "libc.h"
  4. unsigned long __getauxval(unsigned long item)
  5. {
  6. size_t *auxv = libc.auxv;
  7. if (item == AT_SECURE) return libc.secure;
  8. for (; *auxv; auxv+=2)
  9. if (*auxv==item) return auxv[1];
  10. errno = ENOENT;
  11. return 0;
  12. }
  13. weak_alias(__getauxval, getauxval);