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

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

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)exec.3 8.3 (Berkeley) 1/24/94
1.\" Copyright (c) 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

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

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)exec.3 8.3 (Berkeley) 1/24/94
29.\" $FreeBSD: head/lib/libc/gen/exec.3 165903 2007-01-09 00:28:16Z imp $
29.\" $FreeBSD: head/lib/libc/gen/exec.3 179838 2008-06-17 06:26:29Z davidxu $
30.\"
31.Dd January 24, 1994
32.Dt EXEC 3
33.Os
34.Sh NAME
35.Nm execl ,
36.Nm execlp ,
37.Nm execle ,
38.Nm exect ,
39.Nm execv ,
40.Nm execvp ,
30.\"
31.Dd January 24, 1994
32.Dt EXEC 3
33.Os
34.Sh NAME
35.Nm execl ,
36.Nm execlp ,
37.Nm execle ,
38.Nm exect ,
39.Nm execv ,
40.Nm execvp ,
41.Nm execvpe ,
41.Nm execvP
42.Nd execute a file
43.Sh LIBRARY
44.Lb libc
45.Sh SYNOPSIS
46.In unistd.h
47.Vt extern char **environ ;
48.Ft int

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

59.Fc
60.Ft int
61.Fn exect "const char *path" "char *const argv[]" "char *const envp[]"
62.Ft int
63.Fn execv "const char *path" "char *const argv[]"
64.Ft int
65.Fn execvp "const char *file" "char *const argv[]"
66.Ft int
42.Nm execvP
43.Nd execute a file
44.Sh LIBRARY
45.Lb libc
46.Sh SYNOPSIS
47.In unistd.h
48.Vt extern char **environ ;
49.Ft int

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

60.Fc
61.Ft int
62.Fn exect "const char *path" "char *const argv[]" "char *const envp[]"
63.Ft int
64.Fn execv "const char *path" "char *const argv[]"
65.Ft int
66.Fn execvp "const char *file" "char *const argv[]"
67.Ft int
68.Fn execvpe "const char *file" "char *const argv[]" "char *const envp[]"
69.Ft int
67.Fn execvP "const char *file" "const char *search_path" "char *const argv[]"
68.Sh DESCRIPTION
69The
70.Nm exec
71family of functions replaces the current process image with a
72new process image.
73The functions described in this manual page are front-ends for the function
74.Xr execve 2 .

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

113with the file being executed.
114The array of pointers
115.Sy must
116be terminated by a
117.Dv NULL
118pointer.
119.Pp
120The
70.Fn execvP "const char *file" "const char *search_path" "char *const argv[]"
71.Sh DESCRIPTION
72The
73.Nm exec
74family of functions replaces the current process image with a
75new process image.
76The functions described in this manual page are front-ends for the function
77.Xr execve 2 .

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

116with the file being executed.
117The array of pointers
118.Sy must
119be terminated by a
120.Dv NULL
121pointer.
122.Pp
123The
121.Fn execle
122and
124.Fn execle ,
123.Fn exect
125.Fn exect
126and
127.Fn execvpe
124functions also specify the environment of the executed process by following
125the
126.Dv NULL
127pointer that terminates the list of arguments in the argument list
128or the pointer to the argv array with an additional argument.
129This additional argument is an array of pointers to null-terminated strings
130and
131.Em must

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

137.Va environ
138in the current process.
139.Pp
140Some of these functions have special semantics.
141.Pp
142The functions
143.Fn execlp ,
144.Fn execvp ,
128functions also specify the environment of the executed process by following
129the
130.Dv NULL
131pointer that terminates the list of arguments in the argument list
132or the pointer to the argv array with an additional argument.
133This additional argument is an array of pointers to null-terminated strings
134and
135.Em must

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

141.Va environ
142in the current process.
143.Pp
144Some of these functions have special semantics.
145.Pp
146The functions
147.Fn execlp ,
148.Fn execvp ,
149.Fn execvpe ,
145and
146.Fn execvP
147will duplicate the actions of the shell in searching for an executable file
148if the specified file name does not contain a slash
149.Dq Li /
150character.
151For
152.Fn execlp
153and
154.Fn execvp ,
150and
151.Fn execvP
152will duplicate the actions of the shell in searching for an executable file
153if the specified file name does not contain a slash
154.Dq Li /
155character.
156For
157.Fn execlp
158and
159.Fn execvp ,
160.Fn execvpe ,
155search path is the path specified in the environment by
156.Dq Ev PATH
157variable.
158If this variable is not specified,
159the default path is set according to the
160.Dv _PATH_DEFPATH
161definition in
162.In paths.h ,

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

272.Er EIO .
273The behaviour was changed to match the behaviour of
274.Xr sh 1 .
275.Sh ERRORS
276The
277.Fn execl ,
278.Fn execle ,
279.Fn execlp ,
161search path is the path specified in the environment by
162.Dq Ev PATH
163variable.
164If this variable is not specified,
165the default path is set according to the
166.Dv _PATH_DEFPATH
167definition in
168.In paths.h ,

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

278.Er EIO .
279The behaviour was changed to match the behaviour of
280.Xr sh 1 .
281.Sh ERRORS
282The
283.Fn execl ,
284.Fn execle ,
285.Fn execlp ,
280.Fn execvp
286.Fn execvp ,
287.Fn execvpe
281and
282.Fn execvP
283functions
284may fail and set
285.Va errno
286for any of the errors specified for the library functions
287.Xr execve 2
288and

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

314.Fn execvp
315functions
316conform to
317.St -p1003.1-88 .
318The
319.Fn execvP
320function first appeared in
321.Fx 5.2 .
288and
289.Fn execvP
290functions
291may fail and set
292.Va errno
293for any of the errors specified for the library functions
294.Xr execve 2
295and

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

321.Fn execvp
322functions
323conform to
324.St -p1003.1-88 .
325The
326.Fn execvP
327function first appeared in
328.Fx 5.2 .
329The
330.Fn execvpe
331function first appeared in
332.Fx 8.0 .