aboutsummaryrefslogtreecommitdiff
path: root/manual/startup.texi
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2012-05-20 10:34:00 -0700
committerRichard Henderson <rth@twiddle.net>2012-05-20 10:40:35 -0700
commitc7683a6d02f3ed59f5cd119b3e8547f45a15912f (patch)
tree029e73af4f78064dc5788972d5fc3a86fc70f1d6 /manual/startup.texi
parenta6f1845d45d0ea9303b3c71944c0a511e23bde26 (diff)
downloadglibc-c7683a6d02f3ed59f5cd119b3e8547f45a15912f.tar
glibc-c7683a6d02f3ed59f5cd119b3e8547f45a15912f.tar.gz
glibc-c7683a6d02f3ed59f5cd119b3e8547f45a15912f.tar.bz2
glibc-c7683a6d02f3ed59f5cd119b3e8547f45a15912f.zip
Add <sys/auxv.h> and getauxval.
Diffstat (limited to 'manual/startup.texi')
-rw-r--r--manual/startup.texi30
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