1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <errno.h> #include <libc.h> #include <stdio.h> unsigned long getauxval(unsigned long type) { size_t *auxv = __libc.auxv; while (*auxv) { if (*auxv == type) return auxv[1]; auxv += 2; } errno = ENOENT; return 0; }