Executes the file pointed to by the file parameter.
#include <unistd.h> int execvp ( const char *file, char *const argv[]);
Points to a file to execute.
Points to an array of null-terminated strings that represent the parameter list that is available to the new program. The first array entry points to the file name that is associated with the file to execute. The array must be null terminated.
If an error occurs, returns -1 and sets errno to indicate the error. Otherwise, nothing is returned.
IMPORTANT:This function is only available to NLMs that link with the POSIX semantics flag and load into protected address space (ring3). If these requirements are not met, errno is set to ENOSYS.
If the file parameter does not contain a slash (/) character, execvp duplicates the shell by searching for an executable file. It uses the search path specified in the environment by the PATH variable. If this variable is not specified, the default path :/bin:/usr/bin is used.
If permission is denied for a file, execvp continues searching the rest of the search path. If no other file is found, it returns -1 and sets errno to EACCES.
If a file header is not recognized, execvp executes the shell with the path of the file as its first parameter. If this attempt fails, it stops searching.
The execvp function uses the environ external variable as the environment for the new process.
The number of bytes available for the new process's combined parameter and environment lists is defined by ARG_MAX.