Module auxv

Source
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 support PR_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.