summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-06-23 05:22:06 +0000
committered <ed@FreeBSD.org>2008-06-23 05:22:06 +0000
commit6fc79f1dacf676008042f647315769e5e8edbcfa (patch)
tree37f73290d9e8248f3796231b9552e9950ed5a717 /lib/libc
parent88c4783a40954d6c191083f0147479775667be73 (diff)
downloadFreeBSD-src-6fc79f1dacf676008042f647315769e5e8edbcfa.zip
FreeBSD-src-6fc79f1dacf676008042f647315769e5e8edbcfa.tar.gz
Turn execvpe() into an internal libc routine.
Adding exevpe() has caused some ports to break. Even though execvpe() is a useful routine, it does not conform to any standards. This patch is a little bit different from the patch sent to the mailing list. I forgot to remove execvpe from the Symbol.map (which does not seem to miscompile libc, though). Reviewed by: davidxu Approved by: philip
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/Makefile.inc2
-rw-r--r--lib/libc/gen/Symbol.map1
-rw-r--r--lib/libc/gen/exec.317
-rw-r--r--lib/libc/gen/exec.c5
-rw-r--r--lib/libc/gen/posix_spawn.c3
-rw-r--r--lib/libc/include/libc_private.h3
6 files changed, 12 insertions, 19 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 30a8b8f..c050fc7 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 4970bcb..b69a743 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 448a1b9..daeccd1 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 4525ce2..985a09a 100644
--- a/lib/libc/gen/exec.c
+++ b/lib/libc/gen/exec.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <stdarg.h>
#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 a587d9e..8e4e0a4 100644
--- a/lib/libc/gen/posix_spawn.c
+++ b/lib/libc/gen/posix_spawn.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
#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 40a93bc..70e1ef8 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_ */
OpenPOWER on IntegriCloud