Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/auxv.3
Show All 18 Lines | |||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd April 25, 2019 | .Dd August 3, 2019 | ||||
.Dt ELF_AUX_INFO 3 | .Dt ELF_AUX_INFO 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm elf_aux_info | .Nm elf_aux_info | ||||
.Nd extract data from the elf auxiliary vector of the current process | .Nd extract data from the elf auxiliary vector of the current process | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/auxv.h | .In sys/auxv.h | ||||
.Ft int | .Ft int | ||||
.Fn elf_aux_info "int aux" "void *buf" "int buflen" | .Fn elf_aux_info "int aux" "void *buf" "int buflen" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn elf_aux_info | .Fn elf_aux_info | ||||
function retrieves the auxiliary info vector requested in | function retrieves the auxiliary info vector requested in | ||||
.Va aux . | .Va aux . | ||||
The information is stored into the provided buffer if it will fit. | The information is stored into the provided buffer if it will fit. | ||||
The following values, defined in | The following values, defined in | ||||
.In sys/elf_common.h | .In sys/elf_common.h | ||||
can be requested: | can be requested: | ||||
.Bl -tag -width AT_OSRELDATE | .Bl -tag -width AT_PAGESIZESLEN | ||||
.It AT_BASE | |||||
The ELF interpreter's base address. | |||||
.It AT_CANARY | .It AT_CANARY | ||||
The canary value for SSP. | The canary value for SSP. | ||||
.It AT_CANARYLEN | |||||
Length of the AT_CANARY value in bytes. | |||||
.It AT_ENTRY | |||||
The ELF interpreter's entry point. | |||||
.It AT_EGID | |||||
Effective group ID under which the process is executing (unused). | |||||
.It AT_EHDRFLAGS | |||||
Value of the ELF header's e_flags field. | |||||
.It AT_EXECFD | |||||
File descriptor of the program to load. | |||||
.It AT_EXECPATH | |||||
Filesystem path of the program to load. | |||||
.It AT_EUID | |||||
The effective user ID under which the process is executing (unused). | |||||
.It AT_FLAGS | |||||
Process flags. | |||||
.It AT_GID | |||||
The real ID of the group that executed the process (unused). | |||||
.It AT_HWCAP | .It AT_HWCAP | ||||
CPU / hardware feature flags. | CPU / hardware feature flags. The values are architecture-dependent | ||||
bcr: You need to make a line-break after a sentence stop. | |||||
and found in | |||||
.In machine/elf.h . | |||||
.It AT_HWCAP2 | .It AT_HWCAP2 | ||||
CPU / hardware feature flags. | CPU / hardware feature flags. The values are architecture-dependent | ||||
bcrUnsubmitted Not Done Inline ActionsAnother line break after the sentence stop is needed here. bcr: Another line break after the sentence stop is needed here. | |||||
and found in | |||||
.In machine/elf.h . | |||||
.It AT_NCPUS | .It AT_NCPUS | ||||
Number of CPUs. | Number of CPUs. | ||||
.It AT_OSRELDATE | .It AT_OSRELDATE | ||||
Kernel OSRELDATE. | Kernel OSRELDATE. | ||||
.It AT_PAGESIZES | .It AT_PAGESIZES | ||||
Vector of page sizes. | Vector of page sizes. | ||||
.It AT_PAGESIZESLEN | |||||
Length of the AT_PAGESIZES vector in bytes. | |||||
.It AT_PAGESZ | .It AT_PAGESZ | ||||
Page size in bytes. | Page size in bytes. | ||||
.It AT_PHDR | |||||
Program header of program already loaded. | |||||
.It AT_PHENT | |||||
Size of each program header entry. | |||||
.It AT_PHNUM | |||||
Number of program header entries. | |||||
.It AT_STACKPROT | |||||
Stack protection flags. The values are defined in | |||||
.In vm/vm.h . | |||||
.It AT_TIMEKEEP | .It AT_TIMEKEEP | ||||
Pointer to VDSO timehands (for library internal use). | Pointer to VDSO timehands (for library internal use). | ||||
.It AT_UID | |||||
The real ID of the user that executed the process (unused). | |||||
.El | .El | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
Returns zero on success, or an error number on failure. | Returns zero on success, or an error number on failure. | ||||
.Sh ERRORS | .Sh ERRORS | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The provided buffer was not the right size for the requested item. | The provided buffer was not the right size for the requested item. | ||||
.It Bq Er ENOENT | .It Bq Er ENOENT | ||||
The requested item is not available. | The requested item is not available. | ||||
.It Bq Er ENOENT | .It Bq Er ENOENT | ||||
An unknown item was requested. | An unknown item was requested. | ||||
.El | .El | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The | The | ||||
.Fn elf_aux_info | .Fn elf_aux_info | ||||
function appeared in | function appeared in | ||||
.Fx 12.0 . | .Fx 12.0 . | ||||
.Sh BUGS | .Sh 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 | Some items require a "right-sized" buffer while others just require a | ||||
"big enough" buffer. | "big enough" buffer. |
You need to make a line-break after a sentence stop.