From f6adf960ce8f95532fc03d30b2cc356a8099ca5c Mon Sep 17 00:00:00 2001 From: "Shuowang (Wayne) Zhang" Date: Wed, 2 Sep 2020 11:31:51 -0400 Subject: [PATCH] zos: use execvpe() to set environ explictly On z/OS, `execvp()` does not set the environment for child process from `environ` when ran in ASCII mode. Instead, `execvpe()` provided by ZOSLIB must be used to set the environment explicitly. PR-URL: https://github.com/libuv/libuv/pull/3060 Reviewed-By: Richard Lau --- src/unix/process.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/unix/process.c b/src/unix/process.c index 8f94c53b..418bd530 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -44,6 +44,10 @@ extern char **environ; # include #endif +#if defined(__MVS__) +# include "zos-base.h" +#endif + static void uv__chld(uv_signal_t* handle, int signum) { uv_process_t* process; @@ -336,7 +340,11 @@ static void uv__process_child_init(const uv_process_options_t* options, _exit(127); } +#ifdef __MVS__ + execvpe(options->file, options->args, environ); +#else execvp(options->file, options->args); +#endif uv__write_int(error_fd, UV__ERR(errno)); _exit(127); }