I already read the man page and did some googling. Couldn't find anything. Say I run execl with a path argument that doesn't actually contain the program specified in arg[0].
What will it do?
It returns -1 and sets errno
(just try it!). It sets errno
depending on the exact problem encountered.
From the man page:
Errors
EACCES
Search permission is denied on a component of the path prefix offilename
or the name of a script interpreter. (See also path_resolution(7).)
ENAMETOOLONG
filename is too long.
ENOENT
The filefilename
or a script or ELF interpreter does not exist, or a shared library needed for file or interpreter cannot be found.
ENOTDIR
A component of the path prefix offilename
or a script or ELF interpreter is not a directory.