Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (t) tdm_execvep(2)
error codes are defined for process creation functions. The list of _TPC_ macros |
described in that reference page is not complete; for a current description of error |
macros and error codes, see the Guardian header file |
$SYSTEM.ZSPIDEF.ZGRDC or the summary of process-creation errors in the |
Guardian Procedure Calls Reference Manual (see the table entitled "Summary |
of Process Creation Errors").
DESCRIPTION
The tdm_execvep() function replaces the current process image with a new process image. The
new image is constructed from a regular executable file, called a new process image file. The
new process image file is formatted as an executable text or binary file in one of the formats
recognized by the tdm_execvep() function.
The tdm_execvep() function is similar to the tdm_execve() function. The main difference is in
the way the pathname for the process image file is resolved. tdm_execve() always resolves rela-
tive pathnames by prefixing the current working directory. tdm_execvep() sometimes uses the
PATH environment variable; see Identifying the Process Image File, later in this reference
page.
A successful tdm_execvep() function call does not return, because the calling process image is
overlaid by the new process image.
When a program is executed as a result of a tdm_execvep() call, it is entered as a function call:
int main(
int argc,
char ∗∗argv[],
char ∗∗envp);
Here, the argc parameter is the argument count, the argv[]parameter is an array of character
pointers to the arguments themselves, and the envp parameter is a pointer to a character array
listing the environment variables. The argv[]array is terminated by a null pointer. The null
pointer is not counted in argc.
The arguments specified by a program using the tdm_execvep() function are passed on to the
new process image in the corresponding arguments to the main() function.
Use From the Guardian Environment
If called from a Guardian process, the actions of this function are undefined, and errno is set to
[ENOTOSS].
Identifying the Process Image File
The tdm_execvep() function uses the file parameter to identify the process image file. If the
pathname specified as the file parameter starts with a slash (/) character, it is the absolute path-
name. If the pathname does not start with a slash but contains a slash, the pathname is resolved
relative to the current working directory. Otherwise, the pathname does not contain a slash, and
the system searches the directories listed in the PATH environment variable for the file and
prefixes the directory in which the file is found.
Passing the Arguments
The argv[]parameter is an array of character pointers to null-terminated strings. The last
member of this array is a null pointer. These strings constitute the argument list available to the
new process image. The value in argv[0] should point to a filename that is associated with the
process being started by the tdm_execvep() function.
527186-003 Hewlett-Packard Company 8−17