diff options
| author | David Xu <davidxu@FreeBSD.org> | 2008-06-17 06:26:29 +0000 |
|---|---|---|
| committer | David Xu <davidxu@FreeBSD.org> | 2008-06-17 06:26:29 +0000 |
| commit | 947aa542e9b9539d4217d470ab7e3d1fe3b973a5 (patch) | |
| tree | 3becab100d0d969a37794d8b43bde8568de3d68d /lib/libc/gen/exec.c | |
| parent | aec9f8e993baa6914ba55cee23f7125e6c75ce3a (diff) | |
Notes
Diffstat (limited to 'lib/libc/gen/exec.c')
| -rw-r--r-- | lib/libc/gen/exec.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 2cf7a36de163..4525ce210286 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -140,20 +140,15 @@ execv(name, argv) int execvp(const char *name, char * const *argv) { - const char *path; - - /* Get the path we're searching. */ - if ((path = getenv("PATH")) == NULL) - path = _PATH_DEFPATH; - - return (execvP(name, path, argv)); + return (execvpe(name, argv, environ)); } -int -execvP(name, path, argv) +static int +execvPe(name, path, argv, envp) const char *name; const char *path; char * const *argv; + char * const *envp; { char **memp; int cnt, lp, ln; @@ -269,3 +264,21 @@ retry: (void)_execve(bp, argv, environ); done: return (-1); } + +int +execvP(const char *name, const char *path, char * const argv[]) +{ + return execvPe(name, path, argv, environ); +} + +int +execvpe(const char *name, char * const argv[], char * const envp[]) +{ + const char *path; + + /* Get the path we're searching. */ + if ((path = getenv("PATH")) == NULL) + path = _PATH_DEFPATH; + + return (execvPe(name, path, argv, envp)); +} |
