Environment variables are contained in an array of null-terminated strings of the form name=value in the POSIX process. These environment variables are manipulated by the functions listed below, or by the external variable extern char **environ. The names cannot contain the equal sign character (=).
Access to environment variables using **environ cannot be guaranteed in a POSIX application that uses multiple threads. Access by these functions serializes access to the environment variables and guarantees consistency of the environment variable array in a threaded environment.
The functions that manipulate environment variables are listed as follows:
#include <sys/types.h>
char *getenv(const char *name);
int setenv(const char *name, char *newvalue, int overwrite);
int clearenv(void);