Open System Services Programmer's Guide

procresults.pr_pid);
fprintf(stderr, "procresults.pr_errno = %o\n",
procresults.pr_errno);
fprintf(stderr, "procresults.pr_TPCerror = %o\n",
procresults.pr_TPCerror);
fprintf(stderr, "procresults.pr_TPCdetail = %o\n",
procresults.pr_TPCdetail);
fprintf(stderr, "errno = %d\n", errno);
fprintf(stderr, "couldn't spawn: %s\n", buf);
}
/* The parent process waits for the child process to terminate. */
if ( (pid = waitpid(pid, &status, 0)) < 0)
perror("waitpid error");
printf("%% ");
}
exit(0);
}
Note 1
The spawn.h library header file defines the inherit structure, which allows you to specify
the process group ID and signal mask of the new process and a list of signals that the child
process will take default action on.
Note 2
The fd_count and fd_map parameters allow you to control the file descriptors the child
process inherits from the parent. fd_count specifies the number of file descriptors designated
by fd_map. fd_map specifies how the file descriptors in the parent process map to the file
descriptors in the child process. That is, the file descriptor specified in fd_map [0] is copied
to file descriptor 0 (zero) in the child process, and so on.
Using the Guardian API
Using Guardian procedures, you can create and control both OSS and Guardian processes. See
the Guardian Programmer’s Guide for a discussion of the HP signals extension procedures.
Creating and Controlling Guardian Processes
Example 31 manages a named Guardian process from the OSS environment by creating it,
suspending it, returning it to a ready state, and terminating it.
Creating and Controlling Processes 123