The process manager component of procnto is responsible for process creation. If a process wants to create another process, it makes a call to one of the process-creation functions, which then effectively sends a message to the process manager.
Here are the process-creation functions:
- exec*() family of functions: execl() , execle() , execlp() , execlpe() , execv() , execve() , execvp() , execvpe()
- spawn*() family of functions: spawn() , spawnl() , spawnle() , spawnlp() , spawnlpe() , spawnp() , spawnv() , spawnve() , spawnvp() , spawnvpe()
When you start a new process, it replaces the existing process if:
- You specify P_OVERLAY when calling one of the spawn* functions.
- You call one of the exec* routines.
The existing process may be suspended while the new process executes (control continues at the point following the place where the new process was started) in the following situations:
- You specify P_WAIT when calling one of the spawn* functions.
- You call system().
There are several versions of spawn*() and exec*(). The * is one to three letters, where:
- l or v (one is required) indicates the way the process parameters are passed
- p (optional) indicates that the PATH environment variable is searched to locate the program for the process
- e (optional) indicates that the environment variables are being passed
For details on each of these functions, see their entries in the QNX Neutrino C Library Reference. Here we'll mention some of the things common to many of them.