I have been following a system programming course recently and I came through the system calls exec() and execve(). So far I cannot find a
Use man exec and read:
The execv(), execvp(), and execvpe() functions provide an array of pointers to
null-terminated strings that represent the argument list available to the new program.
The first argument, by convention, should point to the filename associated with the file
being executed. The array of pointers must be terminated by a NULL pointer.
execv
int execv(const char *path, char *const argv[]);
So you pass an array as parameters
int execle(const char *path, const char *arg,
..., char * const envp[]);
Almost the same, but not as an array, but rather as a list of values (strings), followed by an array the designates the environment.
Here:
int execvp(const char *file, char *const argv[]);
You are calling a file, without path, so it expects you to be already in the right path
before calling.
Last but not least:
int execve(const char *filename, char *const argv[],
char *const envp[]);
Similar to previous one, but now you have two arrays, for arguments and environment variables.