diff options
Diffstat (limited to 'newlib/libc/posix/execv.c')
-rw-r--r-- | newlib/libc/posix/execv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/newlib/libc/posix/execv.c b/newlib/libc/posix/execv.c index 42a78cb52..5effb9c57 100644 --- a/newlib/libc/posix/execv.c +++ b/newlib/libc/posix/execv.c @@ -6,10 +6,15 @@ #include <_ansi.h> #include <unistd.h> +/* Only deal with a pointer to environ, to work around subtle bugs with shared + libraries and/or small data systems where the user declares his own + 'environ'. */ +static char ***p_environ = &environ; + int _DEFUN (execv, (path, argv), const char *path _AND char * const argv[]) { - return _execve (path, (char * _CONST *) argv, environ); + return _execve (path, (char * _CONST *) argv, *p_environ); } |