Deleted Added
full compact
exec.c (179838) exec.c (179947)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libc/gen/exec.c 179838 2008-06-17 06:26:29Z davidxu $");
34__FBSDID("$FreeBSD: head/lib/libc/gen/exec.c 179947 2008-06-23 05:22:06Z ed $");
35
36#include "namespace.h"
37#include <sys/param.h>
38#include <sys/types.h>
39#include <sys/stat.h>
40#include <errno.h>
41#include <unistd.h>
42#include <stdlib.h>
43#include <string.h>
44#include <stdio.h>
45#include <paths.h>
46
47#include <stdarg.h>
48#include "un-namespace.h"
35
36#include "namespace.h"
37#include <sys/param.h>
38#include <sys/types.h>
39#include <sys/stat.h>
40#include <errno.h>
41#include <unistd.h>
42#include <stdlib.h>
43#include <string.h>
44#include <stdio.h>
45#include <paths.h>
46
47#include <stdarg.h>
48#include "un-namespace.h"
49#include "libc_private.h"
49
50extern char **environ;
51
52int
53execl(const char *name, const char *arg, ...)
54{
55 va_list ap;
56 char **argv;

--- 78 unchanged lines hidden (view full) ---

135{
136 (void)_execve(name, argv, environ);
137 return (-1);
138}
139
140int
141execvp(const char *name, char * const *argv)
142{
50
51extern char **environ;
52
53int
54execl(const char *name, const char *arg, ...)
55{
56 va_list ap;
57 char **argv;

--- 78 unchanged lines hidden (view full) ---

136{
137 (void)_execve(name, argv, environ);
138 return (-1);
139}
140
141int
142execvp(const char *name, char * const *argv)
143{
143 return (execvpe(name, argv, environ));
144 return (_execvpe(name, argv, environ));
144}
145
146static int
147execvPe(name, path, argv, envp)
148 const char *name;
149 const char *path;
150 char * const *argv;
151 char * const *envp;

--- 115 unchanged lines hidden (view full) ---

267
268int
269execvP(const char *name, const char *path, char * const argv[])
270{
271 return execvPe(name, path, argv, environ);
272}
273
274int
145}
146
147static int
148execvPe(name, path, argv, envp)
149 const char *name;
150 const char *path;
151 char * const *argv;
152 char * const *envp;

--- 115 unchanged lines hidden (view full) ---

268
269int
270execvP(const char *name, const char *path, char * const argv[])
271{
272 return execvPe(name, path, argv, environ);
273}
274
275int
275execvpe(const char *name, char * const argv[], char * const envp[])
276_execvpe(const char *name, char * const argv[], char * const envp[])
276{
277 const char *path;
278
279 /* Get the path we're searching. */
280 if ((path = getenv("PATH")) == NULL)
281 path = _PATH_DEFPATH;
282
283 return (execvPe(name, path, argv, envp));
284}
277{
278 const char *path;
279
280 /* Get the path we're searching. */
281 if ((path = getenv("PATH")) == NULL)
282 path = _PATH_DEFPATH;
283
284 return (execvPe(name, path, argv, envp));
285}