.TH execlp() "" "" "General Function (libc)"
.PC "Execute a load module"
.B "#include <unistd.h>"
\fBexeclp(\fIfile, arg0, arg1, ..., argn, \fBNULL)\fR
\fBchar *\fIfile, *arg0, *arg1, ..., \fB*\fIargn\^\fB;\fR
.PP
The function
.B execlp()
calls the \*(CO system call
.B execve()
to execute a program.
It initializes the new stack of the process to contain
a list of strings that are command arguments.
It specifies arguments individually, as a NULL-terminated list of
.I arg
parameters.
Unlike the related function
.BR execl() ,
.B execlp()
searches for
.I file
in all directories named in the environmental variable
.BR PATH .
For more information on program execution, see
.BR execution .
.SH "See Also"
.Xr "environ," environ
.Xr "execution," execution
.Xr "execve()," execve
.Xr "libc," libc
.Xr "unistd.h" unistd.h
.br
\*(PX Standard, \(sc3.1.2
.SH Diagnostics
.B execlp()
does not return if successful.
It returns \-1 for errors, such as
.I file
not existing in the directories named in
.BR PATH ,
not accessible with execute permission, having a bad format,
or too large to fit in memory.
