The Windows processes: _execl() and _spawnl() families

 

Each function in this family as shown below, loads and executes a new process.

 

_execl(), _wexecl()

_execv(), _wexecv()

_execle(), _wexecle()

_execve(), _wexecve()

_execlp(), _wexeclp()

_execvp(), _wexecvp()

_execlpe(), _wexeclpe()

_execvpe(), _wexecvpe()

 

The letter at the end of the function name determines the variation as stated below:

 

e - envp, array of pointers to environment settings, is passed to the new process.

l - Command-line arguments are passed individually to _exec function. Typically used when the number of parameters to the new process is known in advance.

p - PATH environment variable is used to find the file to execute.

v - argv, array of pointers to command-line arguments, is passed to _exec. Typically used when the number of parameters to the new process is variable.

 

Each of the following _spawn functions creates and executes a new process.

 

_spawnl(), _wspawnl()

_spawnv(), _wspawnv()

_spawnle(), _wspawnle()

_spawnve(), _wspawnve()

_spawnlp(), _wspawnlp()

_spawnvp(), _wspawnvp()

_spawnlpe(), _wspawnlpe()

_spawnvpe(), _wspawnvpe()

 

The letters at the end of the function name determine the variation as stated below:

 

e - envp, array of pointers to environment settings, is passed to new process.

l - Command-line arguments are passed individually to _spawn function. This suffix is typically used when a number of parameters to a new process is known in advance.

p - PATH environment variable is used to find the file to execute.

v - argv, array of pointers to command-line arguments, is passed to _spawn function. This suffix is typically used when a number of parameters to a new process is variable.

 

Keep in mind that the listed functions are Microsoft versions (recognized by the prefix underscore ( _ ). You may find similar versions without the prefix underscore in the standard C/ANSI. The prefix 'w' is the wide character/Unicode version.

 

 

C and C++ Programming Resources | C & C++ Code Example Index