ELF_AUX_INFO(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’– 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 by fexecve(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 β€” the OSRELDATE of the kernel or jail the program is running on (sizeof(int)). 🌈
  • AT_PAGESIZES β€” vector of page sizes (arbitrary sized buffer, as many elements of the pagesizes array 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms