Expand description
Linux auxv support.
Β§Safety
This uses raw pointers to locate and read the kernel-provided auxv array.
StructsΒ§
- AuxPointer π
ConstantsΒ§
- PR_
GET_ πAUXV
StaticsΒ§
- CLOCK_
TICKS_ πPER_ SECOND - EXECFN π
- HWCAP π
- HWCAP2 π
- MINSIGSTKSZ π
- PAGE_
SIZE π - SYSINFO_
EHDR π
FunctionsΒ§
- check_
elf_ π βbase - Check that
base
is a valid pointer to the kernel-provided vDSO. - init_
auxv π - Read the auxv records and initialize the various static variables. Panic if an error is encountered.
- init_
auxv_ πimpl - If we donβt have βuse-explicitly-provided-auxvβ or βuse-libc-auxvβ, we
read the aux vector via the
prctl
PR_GET_AUXV
, with a fallback to /proc/self/auxv for kernels that donβt supportPR_GET_AUXV
. - init_
from_ π βaux_ iter - Process auxv entries from the auxv array pointed to by
auxp
. - init_
from_ πauxv_ file - Process auxv entries from the open file
auxv
. - maybe_
init_ πauxv - Like
init_auxv
, but donβt panic if an error is encountered. The caller must be prepared for initialization to be skipped. - pr_
get_ πauxv_ dynamic - Use Linux β₯ 6.4βs
PR_GET_AUXV
to read the aux records, using a provided statically-sized buffer if possible, or a dynamically allocated buffer otherwise. Return: - pr_
get_ πauxv_ static - Use Linux β₯ 6.4βs
PR_GET_AUXV
to read the aux records, into a provided statically-sized buffer. Return: - sysinfo_
ehdr π AT_SYSINFO_EHDR
isnβt present on all platforms in all configurations, so if we donβt see it, this function returns a null pointer.