execl() is a C library function which is used to replace the current process image with a new process image. It belongs to the family of exec() functions and prototyped in unistd.h.
execl() is a C library function which is used to replace the current process image with a new process image. It belongs to the familt of exec() functions and prototyped in unistd.h.
The Function Prototype
int execl(const char *path, const char *arg, ...);
where,
- The first argument is the name of a file that is to be executed.
- The
const char *arg
and subsequent arguments (if any) can be thought of asarg0
,arg1
, ...,argn
. Together they describe a list of one or more pointers to null-terminated strings that represent the argument list available to the executed program.
Return Value
The various exec() functions only return if an error has occurred. The return value is -1, and errno
is set to indicate the error.
Check the Main page for more details.