GETENV(3) Library Functions Manual GETENV(3)

getenvget value of an environment variable

#include <stdlib.h>

char *getenv(const char *name);

The getenv() function searches the environment list for a string of the form " name=value ", and returns a pointer to a string containing the value for the specified name. If the specified name cannot be found, a null pointer is returned. The string pointed to must not be modified by the application, but may be overwritten by a subsequent call to getenv() or putenv(3) but will not be overwritten by a call to any other function in this document.

This interface need not be reentrant.

Upon successful completion, getenv() returns a pointer to a string containing the value for the specified name . If the specified name cannot be found a null pointer is returned.

The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv() or .

No errors are defined.

None.

None.

None.

exec(3) , putenv(3) , <stdlib.h> , the XBD specification, .

Derived from Issue 1 of the SVID.

February 1997 posix.fail