Open System Services System Calls Reference Manual (G06.28+)
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 specified in addition to a list of signals that the child process will
take default action on. The structure is defined in the spawn.h header file.
argv[] Specifies 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
filename of the new process
image. The last member of this array must be a null pointer.
envp[] Specifies 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 defined in the tdmext.h header file.
When this parameter contains a null pointer, the tdm_spawnp() function
assumes default Guardian attributes. Otherwise, the structure must be defined
locally and initialized before its first use. Initialization is done using the
#define
DEFAULT_PROCESS_EXTENSION,asdefined in the tdmext.h header file.
The initialized values can then be modified as appropriate for the call.
pr_results Points to the output structure containing optional process identification 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 defined in the tdmext.h header file.
The structure must be defined locally and initialized before its first use. Initiali-
zation is done by using the #define
DEFAULT_PROCESS_EXTENSION_RESULTS,asdefined in the tdmext.h
header file.
See the process_extension_results(5) reference page for information about the
content of the structure. The tdmext.h header file is not kept current when new
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_spawnp() function creates 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_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 file is resolved. tdm_spawn() always resolves relative
pathnames by prefixing 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
efficient way to create a new process to execute a new program file. However, tdm_spawnp( )
does not provide all the function provided by tdm_fork() and tdm_execvep().
527186-005 Hewlett-Packard Company 8−57