Adds new environment variables or modifies the values of existing ones.
#include <stdlib.h> int setenv(const char *name, const char *value, int overwrite);
name
value
overwrite
The setenv
function operates only on the local process. The process environment is pre-loaded from "global" values which are set in the registry. The registry ...\<nodename>\INTIME.INI\CLIB contains values which are loaded into the environment.
The setenv
function updates or adds a variable in the environment of the calling process. The name
argument points to a string containing the name of an environment variable to be added or altered. The environment variable shall be set to the value to which value
points. The function shall fail if name
points to a string which contains an '=' character. If the environment variable named by name
already exists and the value of overwrite
is non-zero, the function shall return success and the environment shall be updated. If the environment variable named by name
already exists and the value of overwrite is zero, the function shall return success and the environment shall remain unchanged. The strings described by name
and value
are copied by this function.
errno
is set as follows:
EINVAL
ENOMEM
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 6.0 | intime/rt/include/stdlib.h | stdlib.h | clib.lib |