@@ -1032,33 +1032,40 @@ pub const _POSIX_VDISABLE: ::cc_t = 0;
10321032
10331033// keys to the values in the ELF auxiliary vector, usable with getauxval
10341034// found at uapi/linux/auxvec.h in the kernel
1035+ // `man getauxval` for docs. briefly: returns a c_ulong but some are meant as addresses
1036+ // a return of 0 can mean "no entry", in which case bionic sets errno = ENOENT
10351037pub const AT_NULL : :: c_ulong = 0 ;
10361038pub const AT_IGNORE : :: c_ulong = 1 ;
10371039pub const AT_EXECFD : :: c_ulong = 2 ;
1038- pub const AT_PHDR : :: c_ulong = 3 ;
1040+ pub const AT_PHDR : :: c_ulong = 3 ; // address of ELF's program headers
10391041pub const AT_PHENT : :: c_ulong = 4 ;
10401042pub const AT_PHNUM : :: c_ulong = 5 ;
1041- pub const AT_PAGESZ : :: c_ulong = 6 ;
1042- pub const AT_BASE : :: c_ulong = 7 ;
1043+ pub const AT_PAGESZ : :: c_ulong = 6 ; // page size can vary between CPUs for an arch
1044+ pub const AT_BASE : :: c_ulong = 7 ; // address of ld.so
10431045pub const AT_FLAGS : :: c_ulong = 8 ;
1044- pub const AT_ENTRY : :: c_ulong = 9 ;
1046+ pub const AT_ENTRY : :: c_ulong = 9 ; // address of _start
10451047pub const AT_NOTELF : :: c_ulong = 10 ;
10461048pub const AT_UID : :: c_ulong = 11 ;
10471049pub const AT_EUID : :: c_ulong = 12 ;
10481050pub const AT_GID : :: c_ulong = 13 ;
10491051pub const AT_EGID : :: c_ulong = 14 ;
1050- pub const AT_PLATFORM : :: c_ulong = 15 ;
1051- pub const AT_HWCAP : :: c_ulong = 16 ;
1052+ pub const AT_PLATFORM : :: c_ulong = 15 ; // address of a cstr naming the hardware
1053+ pub const AT_HWCAP : :: c_ulong = 16 ; // arch/ABI-specific bitmask
10521054pub const AT_CLKTCK : :: c_ulong = 17 ;
10531055
10541056pub const AT_SECURE : :: c_ulong = 23 ;
1055- pub const AT_BASE_PLATFORM : :: c_ulong = 24 ;
1056- pub const AT_RANDOM : :: c_ulong = 25 ;
1057- pub const AT_HWCAP2 : :: c_ulong = 26 ;
1057+ pub const AT_BASE_PLATFORM : :: c_ulong = 24 ; // address of a cstr, arch-specific meaning
1058+ pub const AT_RANDOM : :: c_ulong = 25 ; // address of [u8; 16]
1059+ pub const AT_HWCAP2 : :: c_ulong = 26 ; // AT_HWCAP ran out of bits
10581060
1059- pub const AT_EXECFN : :: c_ulong = 31 ;
1061+ pub const AT_EXECFN : :: c_ulong = 31 ; // address of executable path name
10601062
1061- pub const AT_MINSIGSTKSZ : :: c_ulong = 51 ;
1063+ // You may be expecting this here:
1064+ // pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
1065+ // Currently it's not defined for Android, as it is defined explicitly by musl and glibc
1066+ // whereas bionic just references kernel headers, which do not for all architectures
1067+
1068+ pub const AT_MINSIGSTKSZ : :: c_ulong = 51 ; // actual MINSIGSTKSZ can vary between CPUs for an arch
10621069// getauxval AT_* values should be current for all "architecture-neutral" ones as of
10631070// Linux headers: include/uapi/linux/auxvec.h kernel 6.1
10641071// Android NDK: libc/kernel/uapi/linux/auxvec.h NDK 25 (updated ~5.14)
0 commit comments