diff options
Diffstat (limited to 'manual')
-rw-r--r-- | manual/startup.texi | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/manual/startup.texi b/manual/startup.texi index ed75e7bdc3..0420e93289 100644 --- a/manual/startup.texi +++ b/manual/startup.texi @@ -34,8 +34,9 @@ This chapter looks at program startup from the execee's point of view. To see the event from the execor's point of view, see @ref{Executing a File}. @menu -* Program Arguments:: Parsing your program's command-line arguments. +* Program Arguments:: Parsing your program's command-line arguments * Environment Variables:: Less direct parameters affecting your program +* Auxiliary Vector:: Least direct parameters affecting your program * System Calls:: Requesting service from the system * Program Termination:: Telling the system you're done; return status @end menu @@ -590,6 +591,33 @@ reordering of command line arguments by @code{getopt} and @c !!! GNU also has COREFILE, CORESERVER, EXECSERVERS @end table +@node Auxiliary Vector +@section Auxiliary Vector +@cindex auxiliary vector + +When a program is executed, it receives information from the operating +system about the environment in which it is operating. The form of this +information is a table of key-value pairs, where the keys are from the +set of @samp{AT_} values in @file{elf.h}. Some of the data is provided +by the kernel for libc consumption, and may be obtained by ordinary +interfaces, such as @code{sysconf}. However, on a platform-by-platform +basis there may be information that is not available any other way. + +@subsection Definition of @code{getauxval} +@comment sys/auxv.h +@deftypefun {unsigned long int} getauxval (unsigned long int @var{type}) +This function is used to inquire about the entries in the auxiliary +vector. The @var{type} argument should be one of the @samp{AT_} symbols +defined in @file{elf.h}. If a matching entry is found, the value is +returned; if the entry is not found, zero is returned. +@end deftypefun + +For some platforms, the key @code{AT_HWCAP} is the easiest way to inquire +about any instruction set extensions available at runtime. In this case, +there will (of necessity) be a platform-specific set of @samp{HWCAP_} +values masked together that describe the capabilities of the cpu on which +the program is being executed. + @node System Calls @section System Calls |