## getenv()

The getenv() function searches the environment list to find the environment variable name, and returns a pointer to the corresponding value string. The getenv() function returns a pointer to the value in the environment, or NULL if there is no match.

## setenv() & putenv()

### setenv()

The setenv() function adds the variable name to the environment with the value value, if name does not already exist. If name does exist in the environment, then its value is changed to value if overwrite is nonzero; if overwrite is zero, then the value of name is not changed. This function makes copies of the strings pointed to by name and value (by contrast with putenv(3)).

The setenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error.

### 注意

env.out执行setenv设置的环境变量，只有在它的那个进程中可用。

## unsetenv()

The unsetenv() function deletes the variable name from the environment. If name does not exist in the environment, then the function succeeds, and the environment is unchanged. The unsetenv() function returns zero on success, or -1 on error, with errno set to indicate the cause of the error.