int exec(const char *path, int path_len, char *const argv[], int argv_len, char *const envp[], envp_len);
This syscall executes the program passed with the passed argv and evp, closing all the threads of the callee process and putting a single one in place for the new program. Other process-specific elements like file descriptors are untouched.
This syscall only returns in failure with -1
with the following errno:
EINVAL
: One of the passed strings or arrays is not valid.
ENOENT
: The file passed in path doesnt exist.
EACCES
: The file couldn’t be launched out of a permission error.