BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

tuxputenv(3c)

Name

tuxputenv() - change or add value to environment

Synopsis

#include <atmi.h>
int tuxputenv(char *string)

Description

string points to a string of the form "name=value." tuxputenv() makes the value of the environment variable name equal to value by altering an existing variable or creating a new one. In either case, the string pointed to by string becomes part of the environment.

This function provides a portable interface to environment variables across the different platforms on which the BEA Tuxedo system is supported, including those platforms that do not normally have environment variables.

Note that tuxputenv() is case-sensitive.

A thread in a multithreaded application may issue a call to tuxputenv() while running in any context state, including TPINVALIDCONTEXT.

Return Values

If tuxputenv() cannot obtain enough space, via malloc(), for an expanded environment, it returns a non-zero integer. Otherwise, it returns zero.

Portability

On MS Windows, this function overcomes the inability to share environment variables between an application and a Dynamic Link Library. The BEA Tuxedo system Workstation DLL maintains an environment copy for each application that is attached to it. This associated environment and context information is destroyed when tpterm() is called from a Windows application. The value of an environment variable could be changed after the application program calls tpterm().

We recommend using upper case variable names for the DOS, Windows, and OS/2, environments. (tuxreadenv() converts all environment variable names to upper case.)

See Also

tuxgetenv(3c), tuxreadenv(3c)