getenv.3c (2010 09)

g
getenv(3C) getenv(3C)
NAME
getenv( ) - return value for environment name
SYNOPSIS
#include <stdlib.h>
char *getenv(const char *name);
DESCRIPTION
getenv() searches the environment list (see environ (5)) for a string of the form name
=value, and
returns a pointer to the value in the current environment if such a string is present or a NULL pointer if
it is not. name can be either the desired name, null-terminated, or of the form name
=value, in which
case
getenv() uses the portion to the left of the
= as the search key.
If the optional HP Getenv-Perf-Enh product is installed on the system, the performance of
getenv() in
threaded applications may increase.
WARNINGS
getenv() returns a pointer to static data which can be overwritten by subsequent calls.
EXTERNAL INFLUENCES
Locale
The
LC_CTYPE category determines the interpretation of characters in name as single and/or multibyte
characters.
International Code Set Support
Single and multibyte character code sets are supported.
SEE ALSO
exec(2), putenv(3C), environ(5), thread_safety(5).
STANDARDS CONFORMANCE
getenv(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.2, ANSI C
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)