diff options
Diffstat (limited to 'lib/libc/sys/execve.2')
-rw-r--r-- | lib/libc/sys/execve.2 | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2 index ca44793..b9fb131 100644 --- a/lib/libc/sys/execve.2 +++ b/lib/libc/sys/execve.2 @@ -29,9 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)execve.2 8.5 (Berkeley) 6/1/94 +.\" @(#)execve.2 8.3 (Berkeley) 1/24/94 .\" -.Dd June 1, 1994 +.Dd January 24, 1994 .Dt EXECVE 2 .Os BSD 4 .Sh NAME @@ -66,11 +66,9 @@ An interpreter file begins with a line of the form: .Ed .Pp When an interpreter file is -.\" was .Fn execve Ap d , -\fBexecve\fP'd, +.Fn execve Ap d , the system -.\" was .Fn execve Ap s -\fBexecve\fP's +.Fn execve Ap s runs the specified .Em interpreter . If the optional @@ -78,16 +76,13 @@ If the optional is specified, it becomes the first argument to the .Em interpreter , and the name of the originally -.\" was .Fn execve Ap d -\fBexecve\fP'd +.Fn execve Ap d file becomes the second argument; otherwise, the name of the originally -.\" was .Fn execve Ap d -\fBexecve\fP'd +.Fn execve Ap d file becomes the first argument. The original arguments are shifted over to become the subsequent arguments. The zeroth argument, normally the name of the -.\" was .Fn execve Ap d -\fBexecve\fP'd +.Fn execve Ap d file, is left unchanged. .Pp The argument @@ -145,7 +140,6 @@ the effective user ID is recorded as the saved set-user-ID, and the effective group ID is recorded as the saved set-group-ID. These values may be used in changing the effective IDs later (see .Xr setuid 2 ) . -.ne 1i .Pp The new process also inherits the following attributes from the calling process: @@ -184,6 +178,23 @@ and .Fa argv points to the array of character pointers to the arguments themselves. +.Sh IMPLEMENTATION NOTES +.Pp +In the non-threaded library +.Fn execve +is implemented as the +.Va execve +syscall. +.Pp +In the threaded library, the +.Va execve +syscall is assembled to +.Fn _thread_sys_execve +and +.Fn execve +is implemented as a function which performs user-thread +library re-initialization and then calls +.Fn _thread_sys_execve . .Sh RETURN VALUES As the .Fn execve @@ -202,8 +213,6 @@ will fail and return to the calling process if: .Bl -tag -width [ENAMETOOLONG] .It Bq Er ENOTDIR A component of the path prefix is not a directory. -.It Bq Er EINVAL -The pathname contains a character with the high-order bit set. .It Bq Er ENAMETOOLONG A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. @@ -223,7 +232,6 @@ permission, but has an invalid magic number in its header. .It Bq Er ETXTBSY The new process file is a pure procedure (shared text) file that is currently open for writing or reading by some process. -.ne 1i .It Bq Er ENOMEM The new process requires more virtual memory than is allowed by the imposed maximum @@ -231,10 +239,10 @@ is allowed by the imposed maximum .It Bq Er E2BIG The number of bytes in the new process's argument list is larger than the system-imposed limit. -The limit in the system as released is 20480 bytes +The limit in the system as released is 65536 bytes .Pf ( Dv NCARGS in -.Ao Pa sys/param.h Ac . +.Ao Pa sys/param.h Ac ) . .It Bq Er EFAULT The new process file is not as long as indicated by the size values in its header. @@ -257,12 +265,13 @@ the real is ``root'', then the program has some of the powers of a super-user as well. .Sh SEE ALSO -.Xr exit 2 , +.Xr _exit 2 , .Xr fork 2 , .Xr execl 3 , +.Xr exit 3 , .Xr environ 7 .Sh HISTORY The -.Nm +.Fn execve function call appeared in .Bx 4.2 . |