Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (n - r) putenv(3)
NAME
putenv - Sets an environment variable
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <stdlib.h>
int putenv(
const char *string);
PARAMETERS
string Points to a string of the form name=value.
DESCRIPTION
The putenv( ) function sets the value of an environment variable by altering an existing variable
or by creating a new one. The string parameter points to a string of the form name=value, where
name is the environment variable and value is the new value for it.
NOTES
The putenv( ) function can be called only by naitve processes.
The putenv( ) function manipulates the environ external variable, and it can be used in conjunc-
tion with the getenv() function.
Use From the Guardian Environment
In Guardian processes, the environment list always contains the following four run-time parame-
ters:
STDIN Species the lename of the standard input le.
STDOUT Species the lename of the standard output le.
STDERR Species the lename of the standard error le.
DEFAULTS Species the default volume and subvolume names used to qualify partial
lenames.
This function is available only in programs using the WIDE model.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Upon failure, the putenv( ) function
returns a nonzero value.
ERRORS
If the following condition occurs, the putenv( ) function sets errno to the corresponding value:
[ENOMEM] Insufcient memory was available.
RELATED INFORMATION
Functions: getenv(3), malloc(3).
Miscellaneous: environ(5).
527192-005 Hewlett-Packard Company 535