Section: Linux Programmer's Manual (3)
getauxval - retrieve a value from the auxiliary vector
unsigned long getauxval(unsigned long type);
function retrieves values from the auxiliary vector,
a mechanism that the kernel's ELF binary loader
uses to pass certain information to
user space when a program is executed.
Each entry in the auxiliary vector consists of a pair of values:
a type that identifies what this entry represents,
and a value for that type.
Given the argument
returns the corresponding value.
The value returned for each
is given in the following list.
values are present on all architectures.
The base address of the program interpreter (usually, the dynamic linker).
A pointer to a string (PowerPC and MIPS only).
On PowerPC, this identifies the real platform; may differ from
this identifies the ISA level (since Linux 5.7).
The frequency with which
This value can also be obtained via
The data cache block size.
The effective group ID of the thread.
The entry address of the executable.
The effective user ID of the thread.
File descriptor of program.
A pointer to a string containing the pathname used to execute the program.
Used FPU control word (SuperH architecture only).
This gives some information about the FPU initialization
performed by the kernel.
The real group ID of the thread.
An architecture and ABI dependent bit-mask whose settings
indicate detailed processor capabilities.
The contents of the bit mask are hardware dependent
(for example, see the kernel source file
for details relating to the Intel x86 architecture; the value
returned is the first 32-bit word of the array described there).
A human-readable version of the same information is available via
- AT_HWCAP2 (since glibc 2.18)
Further machine-dependent hints about processor capabilities.
The instruction cache block size.
Geometry of the L1 data cache, encoded with the cache line size in bytes
in the bottom 16 bits and the cache associativity in the next 16 bits.
The associativity is such that if N is the 16-bit value,
the cache is N-way set associative.
The L1 data cache size.
Geometry of the L1 instruction cache, encoded as for
The L1 instruction cache size.
Geometry of the L2 cache, encoded as for
The L2 cache size.
Geometry of the L3 cache, encoded as for
The L3 cache size.
The system page size (the same value returned by
The address of the program headers of the executable.
The size of program header entry.
The number of program headers.
A pointer to a string that identifies the hardware platform
that the program is running on.
The dynamic linker uses this in the interpretation of
The address of sixteen bytes containing a random value.
Has a nonzero value if this executable should be treated securely.
Most commonly, a nonzero value indicates that the process is
executing a set-user-ID or set-group-ID binary
(so that its real and effective UIDs or GIDs differ from one another),
or that it gained capabilities by executing
a binary file that has capabilities (see
a nonzero value may be triggered by a Linux Security Module.
When this value is nonzero,
the dynamic linker disables the use of certain environment variables (see
and glibc changes other aspects of its behavior.
The entry point to the system call function in the vDSO.
Not present/needed on all architectures (e.g., absent on x86-64).
The address of a page containing the virtual Dynamic Shared Object (vDSO)
that the kernel creates in order to provide fast implementations of
certain system calls.
The unified cache block size.
The real user ID of the thread.
returns the value corresponding to
is not found, 0 is returned.
- ENOENT (since glibc 2.19)
No entry corresponding to
could be found in the auxiliary vector.
function was added to glibc in version 2.16.
For an explanation of the terms used in this section, see
This function is a nonstandard glibc extension.
The primary consumer of the information in the auxiliary vector
is the dynamic linker,
The auxiliary vector is a convenient and efficient shortcut
that allows the kernel to communicate a certain set of standard
information that the dynamic linker usually or always needs.
In some cases, the same information could be obtained by system calls,
but using the auxiliary vector is cheaper.
The auxiliary vector resides just above the argument list and
environment in the process address space.
The auxiliary vector supplied to a program can be viewed by setting the
environment variable when running a program:
$ LD_SHOW_AUXV=1 sleep 1
The auxiliary vector of any process can (subject to file permissions)
be obtained via
for more information.
Before the addition of the
error in glibc 2.19,
there was no way to unambiguously distinguish the case where
could not be found from the case where the value corresponding to
This page is part of release 5.10 of the Linux
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at