.\" $OpenBSD: elf_aux_info.3,v 1.1 2024/07/14 09:48:48 jca Exp $ .\" .\" Origin: FreeBSD auxv.3 .\" .\" Copyright (c) 2019 Ian Lepore .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd $Mdocdate: July 14 2024 $ .Dt ELF_AUX_INFO 3 .Os .Sh NAME .Nm elf_aux_info .Nd extract data from the elf auxiliary vector of the current process .Sh SYNOPSIS .In sys/auxv.h .Ft int .Fn elf_aux_info "int aux" "void *buf" "int buflen" .Sh DESCRIPTION The .Fn elf_aux_info function retrieves the auxiliary info vector requested in .Va aux . The information is stored into the provided buffer if it will fit. The following values can be requested (corresponding buffer sizes are specified in parenthesis): .Bl -tag -width AT_HWCAP2 .It AT_HWCAP CPU / hardware feature flags .Dv (sizeof(unsigned long)) . .It AT_HWCAP2 CPU / hardware feature flags .Dv (sizeof(unsigned long)) . .It AT_PAGESZ Page size in bytes .Dv (sizeof(int)) . .El .Sh RETURN VALUES Returns zero on success, or an error number on failure. .Sh ERRORS .Bl -tag -width Er .It Bq Er EINVAL An unknown item was requested. .It Bq Er EINVAL The provided buffer was not the right size for the requested item. .It Bq Er ENOENT The requested item is not available. .El .Sh HISTORY The .Fn elf_aux_info function appeared in .Fx 12.0 and was first available in .Ox 7.6 .