Open System Services System Calls Reference Manual (G06.27+, H06.04+)

System Functions (t) tdm_spawnp(2)
argv[0] is set to the name of the command interpreter.
If the optional_string portion is present, argv[1] is set to optional_string.
The next element of argv[]is set to the original value of le.
The remaining elements of argv[]are set to the original elements of argv[], starting with
argv[1]. The original argv[0] is discarded.
The S_ISUID and S_ISGID mode bits of an executable text le are ignored.
When the File Is Invalid
If the process image le is not a valid executable object, and it is a regular text le that does not
contain the header line, the tdm_spawnp() function invokes the interpreter_name command
interpreter as the new process image and passes these arguments to it:
argv[0] is set to the string "sh".
argv[1] is set to the original value of the le parameter.
The remaining elements of argv[]are set to the original elements of argv[]starting with
argv[1].
The original argv[0] is discarded.
Open Files
The fd_count and fd_map[]parameters determine which le descriptors that were open in the
calling process remain open in the child process.
fd_count species the number of le descriptors to be designated by the fd_map[]parameter.
fd_map[]species how le descriptors in the parent process map to le descriptors in the child
process. That is, the le descriptor in fd_map[0] is copied to le descriptor 0 (zero) in the child
process, the le descriptor in fd_map[1] is copied to le descriptor 1 in the child process, and so
on. If fd_map[]has a null value, the fd_count parameter is ignored and all open le descriptors
in the parent (except for les opened by Guardian function or procedure calls and those with the
FD_CLOEXEC attribute ag set) are inherited without mapping by the child process. Such
inherited le descriptors behave here as they do for the tdm_execvep() function.
If fd_map[]does not have a null value, le descriptors from fd_count to OPEN_MAX are closed
in the child process, as are entries in fd_map[]that are identied with the value
SPAWN_FDCLOSED.
If a le descriptor specied in fd_map[]is invalid, the function call fails. (Any le descriptor
created by a Guardian function or procedure call is invalid.) The errno variable is set to
[EBADF].
For a G-series TNS process image or an accelerated process image, if the process le segment
(PFS) of the new process image is smaller than the process le segment of the calling process
image and if the calling process image has a large number of le descriptors open, then the sys-
tem might not be able to propagate all the open le descriptors to the new process image. When
this situation occurs, the function call fails, and errno is set to the value of [EMFILE].
Open Pipes and FIFOs
A pipe or FIFO associated with an open le descriptor in the parent process remains connected in
the child process. If the child process runs in a different processor than the parent process, the
processor that runs the child process must also be running an OSS pipe server process.
If no OSS pipe server process is running in the new processor, the child process cannot use the
pipe or FIFO; calls specifying the le descriptor for the pipe or FIFO fail with errno set to
[EWRONGID]. The child process can only close the invalid le descriptor.
527186-004 Hewlett-Packard Company 859