setenv()

set environment variable 

Function


SYNOPSIS

#include <stdlib.h>

int setenv(const char *name, const char *value, int rewrite);


DESCRIPTION

The setenv() function sets an environment variable pointed to by name with the value pointed to by value. If the variable already exists in the environment and rewrite is set, it is overwritten.


PARAMETERS

name 

Points to the name of an environment variable

value 

Points to the value to be assigned to the environment variable.

rewrite 

Replaces the value of the current variable.


RETURN VALUES

The setenv() function returns non-zero if it was unable to obtain enough space using malloc() for an expanded environment, or if the environment variable already exists and the rewrite is not set. Otherwise, it returns zero.


CONFORMANCE

4.4BSD.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
getenv(), putenv(), unsetenv()


MKS Toolkit 9.2 Documentation Build 16.