global array to hold environment variables 

Global Variable


#include <unistd.h>

extern char **environ;


Inclusion of the <unistd.h> header file provides for definitions of environ as shown in the SYNOPSIS section. The environ variable is an array of character strings containing environment variables and their values in the form name=value (environment variable names cannot contain the character '=').

Programs should obtain the definition of environ by the inclusion of <unistd.h>. The practice of defining environ in a program as

extern char **environ;

(without including <unistd.h>) is unsupported.


UNIX 98 with exceptions.


UNIX 98 allows environ to be declared without including <unistd.h>. This is not supported by the NuTCRACKER Platform.

In Windows, environment variable names are case-insensitive. In addition, the environment maintained by Win32 and the environment maintained by the NuTCRACKER Platform are physically separate because their formats are quite different. Because of this it is strongly recommended that environ not be used for direct access to environment variables. Rather the getenv() function should be used to read environment variables the putenv() or setenv() function should be used to set environment variables and the unsetenv() function should be used to remove a variable from the environment. Doing this ensures that the environment remains consistent.


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


_NutWIN32getenv(), _NutWIN32putenv(), execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe(), getenv(), putenv(), setenv(), unsetenv()

PTC MKS Toolkit 10.1 Documentation Build 15.