Executes the file pointed to by the file parameter.
#include <unistd.h> int execlp ( const char *file, const char *arg0, ... );
Points to a file to execute.
Points to the file name that is associated with the file to execute.
Points to one or more null-terminated strings (which can be represented by arg1, arg2, . . . argn) that represent the parameter list that is available to the executed program. The list of parameters must be terminated by a NULL pointer.
If an error occurs, returns -1 and errno is set 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, execlp 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, execlp 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, execlp executes the shell with the path of the file as its first parameter. If this attempt fails, it stops searching.
The execlp 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.