@@ -1032,31 +1032,38 @@ pub const _POSIX_VDISABLE: ::cc_t = 0;
1032
1032
1033
1033
// keys to the values in the ELF auxiliary vector, usable with getauxval
1034
1034
// 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
1035
1037
pub const AT_NULL : :: c_ulong = 0 ;
1036
1038
pub const AT_IGNORE : :: c_ulong = 1 ;
1037
1039
pub 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
1039
1041
pub const AT_PHENT : :: c_ulong = 4 ;
1040
1042
pub const AT_PHNUM : :: c_ulong = 5 ;
1041
1043
pub const AT_PAGESZ : :: c_ulong = 6 ;
1042
- pub const AT_BASE : :: c_ulong = 7 ;
1044
+ pub const AT_BASE : :: c_ulong = 7 ; // address of ld.so
1043
1045
pub 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
1045
1047
pub const AT_NOTELF : :: c_ulong = 10 ;
1046
1048
pub const AT_UID : :: c_ulong = 11 ;
1047
1049
pub const AT_EUID : :: c_ulong = 12 ;
1048
1050
pub const AT_GID : :: c_ulong = 13 ;
1049
1051
pub 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
1052
1054
pub const AT_CLKTCK : :: c_ulong = 17 ;
1053
1055
1054
1056
pub 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
1058
1060
1059
- pub const AT_EXECFN : :: c_ulong = 31 ;
1061
+ pub const AT_EXECFN : :: c_ulong = 31 ; // address of executable path name
1062
+
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
1060
1067
1061
1068
pub const AT_MINSIGSTKSZ : :: c_ulong = 51 ;
1062
1069
// getauxval AT_* values should be current for all "architecture-neutral" ones as of
0 commit comments