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



API introduced: V3R6

[ Back to top | UNIX-Type APIs | APIs by category ]