---
name: "auxv"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/auxv"
---

# auxv(3)

extract data from the elf auxiliary vector of the current process

## NAME

**elf\_aux\_info** – extract data from the elf auxiliary vector of the current process

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/auxv.h\>**

*int*\

**elf\_aux\_info**(*int aux*, *void \*buf*, *int buflen*);

## DESCRIPTION

The **elf\_aux\_info**() function retrieves the auxiliary info vector requested in *aux*. The information is 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). This may not be present if the process was initialized by [fexecve(2)](/fexecve/2.md) 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.

## 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.

## 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.
