Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (t) tdm_spawnp(2)
inherit Points to a structure that allows the process group ID and signal mask of the new
process to be specied in addition to a list of signals that the child process will
take default action on. The structure is dened in the spawn.h header le.
argv[] Species an array of character pointers to null-terminated strings containing
arguments to be passed to the main function of the new program. argv[0] should
point to the null-terminated string containing the
lename of the new process
image. The last member of this array must be a null pointer.
envp[] Species an array of character pointers to null-terminated strings that describe
the environment for the new process.
pe_parms Points to the input structure containing Guardian process attributes to be
assigned to the new process. The structure is dened in the tdmext.h header le.
When this parameter contains a null pointer, the tdm_spawnp() function
assumes default Guardian attributes. Otherwise, the structure must be dened
locally and initialized before its rst use. Initialization is done using the
#dene
DEFAULT_PROCESS_EXTENSION,asdened in the tdmext.h header le.
The initialized values can then be modied as appropriate for the call.
pr_results Points to the output structure containing optional process identication and error
information. In case of error, this structure provides additional information,
including the PROCESS_LAUNCH_ procedure error and error detail. The struc-
ture is dened in the tdmext.h header le.
The structure must be dened locally and initialized before its rst use. Initiali-
zation is done by using the #dene
DEFAULT_PROCESS_EXTENSION_RESULTS,asdened in the tdmext.h
header le. |
See the process_extension_results(5) reference page for information about the |
content of the structure. The tdmext.h header le is not kept current when new |
error codes are dened 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 le |
$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_spawnp() function creates a new process image. The new image is constructed from a
regular executable le, called a new process image le. The new process image le is formatted
as an executable text or binary le in one of the formats recognized by the tdm_spawnp() func-
tion.
The tdm_spawnp() function is similar to the tdm_spawn() function. The main difference is the
way the pathname for the process image le is resolved. tdm_spawn() always resolves relative
pathnames by prexing the current working directory. tdm_spawnp() sometimes uses the
PATH environment variable to resolve pathnames; see Identifying the Process Image File, later
in this reference page.
The tdm_spawnp() function provides a different way to create a new process than the way pro-
vided by the tdm_fork() and tdm_execvep() functions. tdm_spawnp() provides a more
efcient way to create a new process to execute a new program le. However, tdm_spawnp()
does not provide all the function provided by tdm_fork() and tdm_execvep().
527186-003 Hewlett-Packard Company 857