
Int main(int argc, char *argv, char *envp) Program's main function, when it is defined as: The argument vector and environment can be accessed by the new The envp array must be terminated by a NULL pointer. (Thus, in the new program, argv will beĮnvp is an array of pointers to strings, conventionally of theįorm key=value, which are passed as the environment of the new The argv array must be terminatedīy a NULL pointer. Strings (i.e., argv) should contain the filename associated Pathname must be either a binary executable, or a script startingįor details of the latter case, see "Interpreter scripts" below.Īrgv is an array of pointers to strings passed to the new programĪs its command-line arguments.

Stack, heap, and (initialized and uninitialized) data segments. Process to be replaced with a new program, with newly initialized ThisĬauses the program that is currently being run by the calling SYNOPSIS top #include int execve(const char * pathname, char *const argv, char *const envp ) DESCRIPTION top execve() executes the program referred to by pathname.

EXECVE(2) Linux Programmer's Manual EXECVE(2) NAME top
