Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
putenv(3) Guardian Native C Library Calls Reference Manual
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 Specifies the filename of the standard input file.
STDOUT Specifies the filename of the standard output file.
STDERR Specifies the filename of the standard error file.
DEFAULTS Specifies the default volume and subvolume names used to qualify partial
filenames.
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] Insufficient memory was available.
RELATED INFORMATION
Functions: getenv(3), malloc(3).
Miscellaneous: environ(5).
5−40 Hewlett-Packard Company 527192-007