1GETENV(3) Linux Programmer's Manual GETENV(3)
2
3
4
6 getenv - get an environment variable
7
9 #include <stdlib.h>
10
11 char *getenv(const char *name);
12
14 The getenv() function searches the environment list to find the envi‐
15 ronment variable name, and returns a pointer to the corresponding value
16 string.
17
19 The getenv() function returns a pointer to the value in the environ‐
20 ment, or NULL if there is no match.
21
23 SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
24
26 The strings in the environment list are of the form name=value.
27
28 As typically implemented, getenv() returns a pointer to a string within
29 the environment list. The caller must take care not to modify this
30 string, since that would change the environment of the process.
31
32 The implementation of getenv() is not required to be reentrant. The
33 string pointed to by the return value of getenv() may be statically
34 allocated, and can be modified by a subsequent call to getenv(),
35 putenv(3), setenv(3), or unsetenv(3).
36
38 clearenv(3), putenv(3), setenv(3), unsetenv(3), environ(7)
39
41 This page is part of release 3.22 of the Linux man-pages project. A
42 description of the project, and information about reporting bugs, can
43 be found at http://www.kernel.org/doc/man-pages/.
44
45
46
47GNU 2008-03-17 GETENV(3)