Syntax | #include <stdlib.h> int setenv (const char *envname, const char *envval, int overwrite); | |
Description | The The envname argument points to a string containing the name of an environment variable to be added or altered. If the environment variable already exists, two cases must be distinguished: If the value of overwrite is not zero, the environment is changed; if the value is zero, the environment remains unchanged. In both cases the function is terminated successfully. If the application modifies environ or the pointers to which it points, the behavior of The strings described by envname and envval are copied by this function.
| |
Return val. | 0 -1 | if successful. otherwise. |
Errors |
|
|
|
| The envname argument is a null pointer, points to an empty string, or points to a string containing an '=' character. |
|
| Insufficient memory was available to add a variable or its value to the environment. |
See also |
|