@FaheemMitha if the file you're trying to execute doesn't exist, then it can't be executed, and execlp()
returns an error. But if it is successfully executed, then what happens next depends on what the code of the executed program does. It might fail, or it might succeed. But at that point, execlp()
can't return any more, because the program image was replaced. The program calling execlp()
doesn't exist any more at that point. Because it's been replaced with the program you executed.