4 ms·
POSIX requires that the environment variables can be access as an array, through the environ variable. This array is expected to be used with POSIX interfaces s
by fweimer 2y ago
POSIX requires that the environment variables can be access as an array, through the environ variable. This array is expected to be used with POSIX interfaces such as posix_spawn and execve. If the array already has to exist, why not use it in getenv?
A purely hash-based implementation is not possible because there is putenv, and some applications expect modifications of environ to be visible via getenv.