Brain Dump

Exec

Tags
comp-arch

Is a system-call that allows you replace a running process image with a new process image. See exec. Warn: Exec isn't a reversible process. Once you exec you can't restore the previous program or its state afterwards.

Table 1: Suffixes in the exec family of functions and their meaning. tbl:exec-sfx
SuffixDescription
eAccepts an array of pointers to environment variables for the new process.
lCommand line arguments are passed individually (as variadic arguments).
pUse the PATH environment variable to find the file to be executed.
vCommand line arguments are passed as an array of strings (a string[]).

Mnemonically exec is actually a family of functions all beginning with exec and suffixed with one of the flags in tbl:exec-sfx. Note: If the information for a command is passed via an array the last element must be followed by a NULL-element ((char *) NULL) to terminate the array.