IIUC, the standard explicitly permits the FreeBSD behaviour, so the program above does not seem to be conforming: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html If the application switches to a complete new environment by assigning a new value to environ, this can be detected by getenv(), setenv(), unsetenv(), or putenv() and the implementation can at that point reinitialize based on the new environment. (This may include copying the environment strings into a new array and assigning environ to point to it.)