Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "ve" in "execve" mean?

Tags:

posix

What does the ve in execve mean?

I read through man execve but didn't see what it means. I gather it might be "vector" but not sure. What does the ve mean?

like image 253
Elijah Lynn Avatar asked May 19 '18 02:05

Elijah Lynn


2 Answers

execve() is a POSIX (and UNIX systems in general) function of the family of the exec*() functions that replace the current process image.

The v comes from the fact that it takes an argument argv to the vector of arguments to the program (the same way the main function of a C program may take it).

The e comes from another of its arguments, envp, which is similarly a vector of the environment variables (key/value pairs like LANG=en_US.UTF-8).

For more information, see for instance the Open Group's docs on exec*().

like image 189
Acorn Avatar answered Sep 18 '22 13:09

Acorn


From Wikipedia we can see that:

Some implementations provide these functions named with a leading underscore (e.g. _execl).

The base of each is exec (execute), followed by one or more letters:

e – An array of pointers to environment variables is explicitly passed to the >new process image.

l – Command-line arguments are passed individually (a list) to the function.

p – Uses the PATH environment variable to find the file named in the file >argument to be executed.

v – Command-line arguments are passed to the function as an array (vector) of pointers.

In the execl, execlp, execv, and execvp calls, the new process image inherits the current environment variables. (Emphasis mine.)

So your suspicions are correct.

like image 45
Rivasa Avatar answered Sep 20 '22 13:09

Rivasa