Working on a project and when I call execl() it is not working. It is called after a fork and is supposed to reexecute the current file. (argument is declared earlier in the file):
argument = argv[0];
int err =execl(argument, argument, left, "1", NULL);
if (err == -1) printf("never execled");
Everything I have read makes me thing this should work. First argument specifies the path, second the file to be executed, third is a string, fourth is a place holder so that arc == 3 when the execl goes through, and the 4th is a null terminator.
Can anyone help?