Changes to the putenv() function and POSIX compliance

As of z/OS® V1R5 C/C++, the function putenv() places the string passed to putenv() directly into the array of environment variables. This behavior assures compliance with the POSIX standard.

Prior to z/OS V1R5 C/C++, the string used to define the environment variable passed into putenv() was not added to the array of environment variables. Instead, the system copied the string into system-allocated storage.

To allow the POSIX-compliant behavior of putenv(), do nothing; it’s now the default condition.

To restore the previous behavior of putenv(), follow these steps:

  1. Ensure that the environment variable, _EDC_PUTENV_COPY, is available on your pre-z/OS V1R5 system.
  2. Set the environment variable _EDC_PUTENV_COPY to "YES".
For additional information, see:
  • z/OS XL C/C++ Runtime Library Reference
  • _EDC_PUTENV_COPY in z/OS XL C/C++ Programming Guide