]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/gen/auxv.3
getvfsbyname: prefer sizeof to strlen even for constants
[FreeBSD/FreeBSD.git] / lib / libc / gen / auxv.3
1 .\"
2 .\" Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\"
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd April 25, 2019
28 .Dt ELF_AUX_INFO 3
29 .Os
30 .Sh NAME
31 .Nm elf_aux_info
32 .Nd extract data from the elf auxiliary vector of the current process
33 .Sh LIBRARY
34 .Lb libc
35 .Sh SYNOPSIS
36 .In sys/auxv.h
37 .Ft int
38 .Fn elf_aux_info "int aux" "void *buf" "int buflen"
39 .Sh DESCRIPTION
40 The
41 .Fn elf_aux_info
42 function retrieves the auxiliary info vector requested in
43 .Va aux .
44 The information is stored into the provided buffer if it will fit.
45 The following values, defined in
46 .In sys/elf_common.h
47 can be requested:
48 .Bl -tag -width AT_OSRELDATE
49 .It AT_CANARY
50 The canary value for SSP.
51 .It AT_HWCAP
52 CPU / hardware feature flags.
53 .It AT_HWCAP2
54 CPU / hardware feature flags.
55 .It AT_NCPUS
56 Number of CPUs.
57 .It AT_OSRELDATE
58 Kernel OSRELDATE.
59 .It AT_PAGESIZES
60 Vector of page sizes.
61 .It AT_PAGESZ
62 Page size in bytes.
63 .It AT_TIMEKEEP
64 Pointer to VDSO timehands (for library internal use).
65 .El
66 .Sh RETURN VALUES
67 Returns zero on success, or an error number on failure.
68 .Sh ERRORS
69 .Bl -tag -width Er
70 .It Bq Er EINVAL
71 An unknown item was requested.
72 .It Bq Er EINVAL
73 The provided buffer was not the right size for the requested item.
74 .It Bq Er ENOENT
75 The requested item is not available.
76 .El
77 .Sh HISTORY
78 The
79 .Fn elf_aux_info
80 function appeared in
81 .Fx 12.0 .
82 .Sh BUGS
83 Only a small subset of available auxiliary info vector items are
84 accessible with this function.
85 Some items require a "right-sized" buffer while others just require a
86 "big enough" buffer.