Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (t) tdm_spawn(2)
When the File Is Invalid
If the process image file is not a valid executable object, or if the text file does not contain the
header line, the tdm_spawn() function returns and sets errno to [ENOEXEC].
Open Files
The fd_count and fd_map[]parameters determine which file descriptors that were open in the
calling process remain open in the new process.
fd_count specifies the number of file descriptors to be designated by the fd_map[]parameter.
fd_map[]specifies how file descriptors in the parent process map to file descriptors in the new
process. That is, the file descriptor in fd_map[0] is copied to file descriptor 0 (zero) in the new
process, the file descriptor in fd_map[1] is copied to file descriptor 1 in the new process, and so
on. If fd_map[]has a null value, the fd_count parameter is ignored and all open file descriptors
in the parent (except for files opened by Guardian function or procedure calls and those with the
FD_CLOEXEC attribute flag set) are inherited without mapping by the new process. Such
inherited file descriptors behave here as they do for the tdm_execve() function.
If fd_map[]does not have a null value, file descriptors from fd_count to OPEN_MAX are closed
in the new process, as are entries in fd_map[]that are identified with the value
SPAWN_FDCLOSED.
If a file descriptor specified in fd_map[]is invalid, the function call fails. (Any file 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 only, if the process file seg-
ment (PFS) of the new process image is smaller than the process file segment of the calling pro-
cess image and if the calling process image has a large number of file descriptors open, then the
system might not be able to propagate all the open file 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 file 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 file descriptor for the pipe or FIFO fail with errno set to
[EWRONGID]. The child process can only close the invalid file descriptor.
Existing Sockets
A socket associated with an open file descriptor in the calling process remains connected in the
new process when the new process runs in the same processor as the calling process.
When the new process runs in a different processor than the calling process, the processor that
runs the new process must also be running a socket transport agent process. If no socket tran-
sport agent process is running in the new processor, the new process cannot use the socket; calls
specifying the file descriptor for the socket fail with errno set to [EWRONGID]. The new pro-
cess can only close the invalid file descriptor.
Sharing Guardian Files
After a successful call to the tdm_spawn() function, the initial position within an open EDIT file
(file code 101) in the Guardian file system (a file in /G) that was opened by a call to the OSS
open() function is the same for both the parent and child processes. However, the position is not
shared; that is, changing the position used by one process does not change the position used by
the other process.
527186-003 Hewlett-Packard Company 8−43