Deleted Added
full compact
execve.2 (21570) execve.2 (23660)
1.\" Copyright (c) 1980, 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.

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

24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
1.\" Copyright (c) 1980, 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.

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

24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)execve.2 8.3 (Berkeley) 1/24/94
32.\" @(#)execve.2 8.5 (Berkeley) 6/1/94
33.\"
33.\"
34.Dd January 24, 1994
34.Dd June 1, 1994
35.Dt EXECVE 2
36.Os BSD 4
37.Sh NAME
38.Nm execve
39.Nd execute a file
40.Sh SYNOPSIS
41.Fd #include <unistd.h>
42.Ft int

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

61.Pp
62.Bd -filled -offset indent -compact
63.Sy \&#!
64.Em interpreter
65.Bq Em arg
66.Ed
67.Pp
68When an interpreter file is
35.Dt EXECVE 2
36.Os BSD 4
37.Sh NAME
38.Nm execve
39.Nd execute a file
40.Sh SYNOPSIS
41.Fd #include <unistd.h>
42.Ft int

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

61.Pp
62.Bd -filled -offset indent -compact
63.Sy \&#!
64.Em interpreter
65.Bq Em arg
66.Ed
67.Pp
68When an interpreter file is
69.Fn execve Ap d ,
69.\" was .Fn execve Ap d ,
70\fBexecve\fP'd,
70the system
71the system
71.Fn execve Ap s
72.\" was .Fn execve Ap s
73\fBexecve\fP's
72runs the specified
73.Em interpreter .
74If the optional
75.Em arg
76is specified, it becomes the first argument to the
77.Em interpreter ,
78and the name of the originally
74runs the specified
75.Em interpreter .
76If the optional
77.Em arg
78is specified, it becomes the first argument to the
79.Em interpreter ,
80and the name of the originally
79.Fn execve Ap d
81.\" was .Fn execve Ap d
82\fBexecve\fP'd
80file becomes the second argument;
81otherwise, the name of the originally
83file becomes the second argument;
84otherwise, the name of the originally
82.Fn execve Ap d
85.\" was .Fn execve Ap d
86\fBexecve\fP'd
83file becomes the first argument. The original arguments are shifted over to
84become the subsequent arguments. The zeroth argument, normally the name of the
87file becomes the first argument. The original arguments are shifted over to
88become the subsequent arguments. The zeroth argument, normally the name of the
85.Fn execve Ap d
89.\" was .Fn execve Ap d
90\fBexecve\fP'd
86file, is left unchanged.
87.Pp
88The argument
89.Fa argv
90is a pointer to a null-terminated array of
91character pointers to null-terminated character strings.
92These strings construct the argument list to be made available to the new
93process. At least one argument must be present in

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

135The real user ID, real group ID and
136other group IDs of the new process image remain the same as the calling
137process image.
138After any set-user-ID and set-group-ID processing,
139the effective user ID is recorded as the saved set-user-ID,
140and the effective group ID is recorded as the saved set-group-ID.
141These values may be used in changing the effective IDs later (see
142.Xr setuid 2 ) .
91file, is left unchanged.
92.Pp
93The argument
94.Fa argv
95is a pointer to a null-terminated array of
96character pointers to null-terminated character strings.
97These strings construct the argument list to be made available to the new
98process. At least one argument must be present in

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

140The real user ID, real group ID and
141other group IDs of the new process image remain the same as the calling
142process image.
143After any set-user-ID and set-group-ID processing,
144the effective user ID is recorded as the saved set-user-ID,
145and the effective group ID is recorded as the saved set-group-ID.
146These values may be used in changing the effective IDs later (see
147.Xr setuid 2 ) .
148.ne 1i
143.Pp
144The new process also inherits the following attributes from
145the calling process:
146.Pp
147.Bl -column parent_process_ID -offset indent -compact
148.It process ID Ta see Xr getpid 2
149.It parent process ID Ta see Xr getppid 2
150.It process group ID Ta see Xr getpgrp 2

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

227.It Bq Er EACCES
228The new process file mode denies execute permission.
229.It Bq Er ENOEXEC
230The new process file has the appropriate access
231permission, but has an invalid magic number in its header.
232.It Bq Er ETXTBSY
233The new process file is a pure procedure (shared text)
234file that is currently open for writing or reading by some process.
149.Pp
150The new process also inherits the following attributes from
151the calling process:
152.Pp
153.Bl -column parent_process_ID -offset indent -compact
154.It process ID Ta see Xr getpid 2
155.It parent process ID Ta see Xr getppid 2
156.It process group ID Ta see Xr getpgrp 2

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

233.It Bq Er EACCES
234The new process file mode denies execute permission.
235.It Bq Er ENOEXEC
236The new process file has the appropriate access
237permission, but has an invalid magic number in its header.
238.It Bq Er ETXTBSY
239The new process file is a pure procedure (shared text)
240file that is currently open for writing or reading by some process.
241.ne 1i
235.It Bq Er ENOMEM
236The new process requires more virtual memory than
237is allowed by the imposed maximum
238.Pq Xr getrlimit 2 .
239.It Bq Er E2BIG
240The number of bytes in the new process's argument list
241is larger than the system-imposed limit.
242The limit in the system as released is 65536 bytes

--- 35 unchanged lines hidden ---
242.It Bq Er ENOMEM
243The new process requires more virtual memory than
244is allowed by the imposed maximum
245.Pq Xr getrlimit 2 .
246.It Bq Er E2BIG
247The number of bytes in the new process's argument list
248is larger than the system-imposed limit.
249The limit in the system as released is 65536 bytes

--- 35 unchanged lines hidden ---