Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

getenv - get value of environment variable

&pagelevel(4)&pagelevel

Definition   

#include <stdlib.h>

char *getenv(const char *name);

getenv() searches the current environment of the process, i.e. the string array pointed to
by environ, for a string of the form "name=value" and returns a pointer to the string
containing the value for the specified variable name.

Return val.

Value of name


if a corresponding string exists.

Null pointer

if no corresponding string exists, or if the S variable SYSPOSIX does not exist.

Notes

The string "name=value" cannot be altered, but may be overwritten by subsequent putenv calls. Other library functions do not overwrite the string.

When a program is started, the S variable SYSPOSIX is evaluated as part of the environment definition in addition to the defaults for the environment (see section “Environmentvariables”).

See also

environ, putenv, stdlib.h.