ELF_AUX_INFO(3)
π NAME π
okay so ELF_AUX_INFO(3) is the page for elf_aux_info(), and it's literally about extracting data from the elf auxiliary vector of the current process. bestie, it's giving βlibc girlie asks the process for one specific auxv itemβ and honestly? iconic. π
π«Ά LIBRARY π«Ά
Standard C Library (libc, -lc) β yeah, she lives in libc. π
β¨ SYNOPSIS β¨
#include <sys/auxv.h>
int
elf_aux_info(int aux, void *buf, int buflen);
πΈ DESCRIPTION πΈ
okay so elf_aux_info() retrieves the auxiliary info vector requested in aux. the info gets stored into the provided buffer if it will fit. π«Ά
The following values, defined in <sys/elf_common.h>, can be requested (corresponding buffer sizes are specified in parenthesis):
AT_CANARYβ the canary value for SSP. arbitrary sized buffer: as many bytes are returned as it fits into it, rest is zeroed. π‘οΈAT_EXECPATHβ the path of executed program (MAXPATHLEN). heads up: this may not be present if the process was initialized byfexecve(2)and the namecache no longer contains the file's name. πAT_HWCAPβ CPU / hardware feature flags (sizeof(u_long)). π₯AT_HWCAP2β CPU / hardware feature flags (sizeof(u_long)). π₯AT_HWCAP3β CPU / hardware feature flags (sizeof(u_long)). π₯AT_HWCAP4β CPU / hardware feature flags (sizeof(u_long)). π₯AT_NCPUSβ number of CPUs (sizeof(int)). π§AT_OSRELDATEβ theOSRELDATEof the kernel or jail the program is running on (sizeof(int)). πAT_PAGESIZESβ vector of page sizes (arbitrary sized buffer, as many elements of thepagesizesarray are returned as it fits). π¦AT_PAGESZβ page size in bytes (sizeof(int)). πAT_TIMEKEEPβ pointer to VDSO timehands (for library internal use,sizeof(void *)). β°AT_USRSTACKBASEβ top of the user stack for main thread. π₯AT_USRSTACKLIMβ limit for grow of the user stack for main thread. π₯
π¦ RETURN VALUES π¦
Returns zero on success, or an error number on failure. zero is the slay outcome, no cap. π
π ERRORS π
[EINVAL]β an unknown item was requested. π[EINVAL]β the provided buffer was not the right size for the requested item. π¬[ENOENT]β the requested item is not available. π
π HISTORY π
The elf_aux_info() function appeared in FreeBSD 12.0. periodt. β¨
πΊ BUGS πΊ
Only a small subset of available auxiliary info vector items are accessible with this function. Some items require a "right-sized" buffer while others just require a "big enough" buffer. lowkey important β don't assume every auxv item is reachable, bestie. π
π cute sign-off: source/version Debian, date June 24, 2025, manual ELF_AUX_INFO(3). catch u later, bestie β go extract that data and slay π
β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms