blob: b846c80fdd4c0567cc3223398b57fdedd0f0b0a2 [file] [log] [blame]
Rich Felker21ada942014-04-07 02:46:15 -04001#include <sys/auxv.h>
2#include <errno.h>
3#include "libc.h"
4
5unsigned long getauxval(unsigned long item)
6{
7 size_t *auxv = libc.auxv;
Rich Felker7bece9c2014-07-17 22:01:52 -04008 if (item == AT_SECURE) return libc.secure;
Rich Felker21ada942014-04-07 02:46:15 -04009 for (; *auxv; auxv+=2)
10 if (*auxv==item) return auxv[1];
11 errno = ENOENT;
12 return 0;
13}