Skip to content

RUN-PROGRAM: Try to use execvp even if :ENVIRON is specified

Unfortunately, execvpe is not standard. However, we can replicate its behavior by pointing **environ to a new array of environment variable assignments before execvp.

On Darwin, shared libraries do not have direct access to **environ. Instead, we use the return value of _NSGetEnviron().

Rename all existing uses of environ (as a variable name) to my_environ as environ now names a macro on both Darwin and Mingw.

If the target does not HAVE_ENVIRON, fall back to execve as before.

Additionally, rewrite PROCESS-ENVIRON tests to highlight that there was a masked failure before.

Tested on a recent Gentoo Linux and x86_64 Mac running Monterey.

Edited by Eric Timmons

Merge request reports

Loading