4.11.7. getenv()

This is the standard C library getenv() function from stdlib.h.


char *getenv(const char *name);


The default implementation returns NULL indicatingthat no environment information is available. You can re-implement getenv() yourself. It depends on no other function and no other function depends on it.

If you redefine the function, you can also call a function _getenv_init() which the C library initialization code calls when the library is initialized, that is before main() is entered.

The function searches the environment list, provided by the host environment, for a string that matches the string pointed to by name. The set of environment names and the method for altering the environment list are implementation-defined.


The return value is a pointer to a string associated with the matched list member. The array pointed to must not be modified by the program, but might be overwritten by a subsequent call to getenv().

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D