diff --git a/include/unistd.h b/include/unistd.h index cfc8ce4635b3..53efe498b681 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -335,7 +335,6 @@ int execlp(const char *, const char *, ...); int execv(const char *, char * const *); int execve(const char *, char * const *, char * const *); int execvp(const char *, char * const *); -int execvpe(const char *, char * const *, char * const *); pid_t fork(void); long fpathconf(int, int); char *getcwd(char *, size_t); diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 30a8b8f24bd3..c050fc79d32d 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -81,7 +81,7 @@ MLINKS+=err.3 err_set_exit.3 err.3 err_set_file.3 err.3 errc.3 err.3 errx.3 \ err.3 verr.3 err.3 verrc.3 err.3 verrx.3 err.3 vwarn.3 err.3 vwarnc.3 \ err.3 vwarnx.3 err.3 warnc.3 err.3 warn.3 err.3 warnx.3 MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 exect.3 \ - exec.3 execv.3 exec.3 execvP.3 exec.3 execvp.3 exec.3 execvpe.3 + exec.3 execv.3 exec.3 execvP.3 exec.3 execvp.3 MLINKS+=fpclassify.3 finite.3 fpclassify.3 finitef.3 \ fpclassify.3 isfinite.3 fpclassify.3 isinf.3 fpclassify.3 isnan.3 \ fpclassify.3 isnormal.3 diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 4970bcb789e7..b69a7432e84e 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -329,7 +329,6 @@ FBSD_1.0 { }; FBSD_1.1 { - execvpe; fdopendir; fts_open; fts_close; diff --git a/lib/libc/gen/exec.3 b/lib/libc/gen/exec.3 index 448a1b9fd423..daeccd10bf47 100644 --- a/lib/libc/gen/exec.3 +++ b/lib/libc/gen/exec.3 @@ -38,7 +38,6 @@ .Nm exect , .Nm execv , .Nm execvp , -.Nm execvpe , .Nm execvP .Nd execute a file .Sh LIBRARY @@ -65,8 +64,6 @@ .Ft int .Fn execvp "const char *file" "char *const argv[]" .Ft int -.Fn execvpe "const char *file" "char *const argv[]" "char *const envp[]" -.Ft int .Fn execvP "const char *file" "const char *search_path" "char *const argv[]" .Sh DESCRIPTION The @@ -121,10 +118,9 @@ be terminated by a pointer. .Pp The -.Fn execle , -.Fn exect +.Fn execle and -.Fn execvpe +.Fn exect functions also specify the environment of the executed process by following the .Dv NULL @@ -146,7 +142,6 @@ Some of these functions have special semantics. The functions .Fn execlp , .Fn execvp , -.Fn execvpe , and .Fn execvP will duplicate the actions of the shell in searching for an executable file @@ -157,7 +152,6 @@ For .Fn execlp and .Fn execvp , -.Fn execvpe , search path is the path specified in the environment by .Dq Ev PATH variable. @@ -283,8 +277,7 @@ The .Fn execl , .Fn execle , .Fn execlp , -.Fn execvp , -.Fn execvpe +.Fn execvp and .Fn execvP functions @@ -326,7 +319,3 @@ The .Fn execvP function first appeared in .Fx 5.2 . -The -.Fn execvpe -function first appeared in -.Fx 8.0 . diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 4525ce210286..985a09a4fcf7 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +#include "libc_private.h" extern char **environ; @@ -140,7 +141,7 @@ execv(name, argv) int execvp(const char *name, char * const *argv) { - return (execvpe(name, argv, environ)); + return (_execvpe(name, argv, environ)); } static int @@ -272,7 +273,7 @@ execvP(const char *name, const char *path, char * const argv[]) } int -execvpe(const char *name, char * const argv[], char * const envp[]) +_execvpe(const char *name, char * const argv[], char * const envp[]) { const char *path; diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c index a587d9ec53c0..8e4e0a44ebf0 100644 --- a/lib/libc/gen/posix_spawn.c +++ b/lib/libc/gen/posix_spawn.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" extern char **environ; @@ -212,7 +213,7 @@ do_posix_spawn(pid_t *pid, const char *path, _exit(127); } if (use_env_path) - execvpe(path, argv, envp != NULL ? envp : environ); + _execvpe(path, argv, envp != NULL ? envp : environ); else _execve(path, argv, envp != NULL ? envp : environ); error = errno; diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 40a93bc1f50f..70e1ef81014c 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -195,4 +195,7 @@ extern void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t) /* Without back-compat translation */ extern int __sys_fcntl(int, int, ...); +/* execve() with PATH processing to implement posix_spawnp() */ +int _execvpe(const char *, char * const *, char * const *); + #endif /* _LIBC_PRIVATE_H_ */