Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/execve.2
Show All 27 Lines | |||||
.\" @(#)execve.2 8.5 (Berkeley) 6/1/94 | .\" @(#)execve.2 8.5 (Berkeley) 6/1/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 21, 2010 | .Dd September 21, 2010 | ||||
.Dt EXECVE 2 | .Dt EXECVE 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm execve , | .Nm execve , | ||||
.Nm fexecve | .Nm fexecve, | ||||
.Nm ffexecve | |||||
.Nd execute a file | .Nd execute a file | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In unistd.h | .In unistd.h | ||||
.Ft int | .Ft int | ||||
.Fn execve "const char *path" "char *const argv[]" "char *const envp[]" | .Fn execve "const char *path" "char *const argv[]" "char *const envp[]" | ||||
.Ft int | .Ft int | ||||
.Fn fexecve "int fd" "char *const argv[]" "char *const envp[]" | .Fn fexecve "int fd" "char *const argv[]" "char *const envp[]" | ||||
.Ft int | |||||
.Fn ffexecve "int interp" "int fd" "char *const argv[]" "char *const envp[]" | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn execve | .Fn execve | ||||
system call | system call | ||||
transforms the calling process into a new process. | transforms the calling process into a new process. | ||||
The new process is constructed from an ordinary file, | The new process is constructed from an ordinary file, | ||||
whose name is pointed to by | whose name is pointed to by | ||||
.Fa path , | .Fa path , | ||||
called the | called the | ||||
.Em new process file . | .Em new process file . | ||||
The | The | ||||
.Fn fexecve | .Fn fexecve | ||||
system call is equivalent to | system call is equivalent to | ||||
.Fn execve | .Fn execve | ||||
except that the file to be executed is determined by the file | except that the file to be executed is determined by the file | ||||
descriptor | descriptor | ||||
.Fa fd | .Fa fd | ||||
instead of a | instead of a | ||||
.Fa path . | .Fa path . | ||||
The | |||||
.Fn ffexecve | |||||
system call is equivalent to | |||||
.Fn fexecve | |||||
except that the run-time linker for the file is specified explicitly | |||||
by the file descriptor | |||||
.Fa interp | |||||
instead of implicitly via the kernel's default logic | |||||
(e.g., using the run-time linker specified in an ELF program header). | |||||
This file is either an executable object file, | This file is either an executable object file, | ||||
or a file of data for an interpreter. | or a file of data for an interpreter. | ||||
An executable object file consists of an identifying header, | An executable object file consists of an identifying header, | ||||
followed by pages of data representing the initial program (text) | followed by pages of data representing the initial program (text) | ||||
and initialized data pages. | and initialized data pages. | ||||
Additional pages may be specified | Additional pages may be specified | ||||
by the header to be initialized with zero data; see | by the header to be initialized with zero data; see | ||||
.Xr elf 5 | .Xr elf 5 | ||||
▲ Show 20 Lines • Show All 305 Lines • Show Last 20 Lines |