diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -136,7 +136,7 @@ int execvp(const char *name, char * const *argv) { - return (execvpe(name, argv, environ)); + return (__libc_execvpe(name, argv, environ)); } static int @@ -288,7 +288,7 @@ } int -execvpe(const char *name, char * const argv[], char * const envp[]) +__libc_execvpe(const char *name, char * const argv[], char * const envp[]) { const char *path; @@ -298,3 +298,5 @@ return (execvPe(name, path, argv, envp)); } + +__weak_reference(__libc_execvpe, execvpe); diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c --- a/lib/libc/gen/posix_spawn.c +++ b/lib/libc/gen/posix_spawn.c @@ -261,7 +261,7 @@ } envp = psa->envp != NULL ? psa->envp : environ; if (psa->use_env_path) - execvpe(psa->path, psa->argv, envp); + __libc_execvpe(psa->path, psa->argv, envp); else _execve(psa->path, psa->argv, envp); psa->error = errno; diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -345,6 +345,7 @@ struct __wrusage; enum idtype; +int __libc_execvpe(const char *, char * const *, char * const *); int __libc_sigaction(int, const struct sigaction *, struct sigaction *) __hidden; int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *)