Qp0zInitEnv()--Initialize Environment for Variables
Syntax
#include <qp0z1170.h> int Qp0zInitEnv(void);;Service Program Name: QP0ZCPA
Default Public Authority: *USE
Threadsafe: Yes
The Qp0zInitEnv() function sets the external variable environ to a pointer to the current environment list. (On the IBM® i operating system, environ is initialized to NULL when an activation group is started.)
Note: Although it is possible for a user's program to
directly read the environ array, use of the
getenv() or Qp0zGetEnv() functions is
recommended.
Authorities and Locks
None.
Parameters
None.
Return Value
| 0 | Qp0zInitEnv() successfully initialized the environment. |
| -1 | Qp0zInitEnv() was not successful. The errno variable is set to indicate the error. |
Error Conditions
If Qp0zInitEnv() is not successful, errno indicates the following error.
- [EUNKNOWN]
-
Unknown system state.
The operation failed because of an unknown system state. See any messages in the job log and correct any errors that are indicated, then retry the operation.
Related Information
- The <qp0z1170.h> file (see Header Files for UNIX®-Type Functions)
- getenv()--Get Value of Environment Variable
- putenv()--Change or Add Environment Variable
- Qp0zDltEnv()--Delete an Environment Variable
- Qp0zDltSysEnv()--Delete a System-Level Environment Variable
- Qp0zGetAllSysEnv()--Get All System-Level Environment Variables
- Qp0zGetEnv()--Get Value of Environment Variable (Extended)
- Qp0zGetSysEnv()--Get Value of System-Level Environment Variable
- Qp0zPutEnv()--Change or Add Environment Variable (Extended)
- Qp0zPutSysEnv()--Change or Add a System-Level Environment
API introduced: V3R6