3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 proc \- process control routines
46 Proc_t* procopen(const char* \fIcommand\fP, char** \fIargv\fP, char** \fIenvv\fP, long* \fIopv\fP, long \fIflags\fP);
47 int procfree(Proc_t* \fIproc\fP);
48 int procclose(Proc_t* \fIproc\fP);
49 int procrun(const char* \fIcommand\fP, char** \fIargv\fP);
52 These routines provide a portable interface to process creation and execution.
53 They work on systems with
57 as well as on systems with only
67 environment modifications in
69 file descriptor, signal and process group operations in
75 is searched for using the
77 environment variable from the calling environment.
82 then the current shell is used (see
91 \fIname\fP[=\fIvalue\fP]
92 strings that are added to the
98 appears in the parent environment then its value is replaced with the new
104 is removed from the child environment.
107 environment variable is set to contain the pathname for
109 and will appear at the top of the child environment.
115 then it is a 0 terminaled vector of operations to perform.
122 for the child and parent process context respectively.
123 Valid operations are:
125 \f5PROC_FD_CLOSE(\fIfd\fP,\fIcontext\fP)\fR
131 \f5PROC_FD_DUP(\fIfrom\fP,\fIto\fP,\fIcontext\fP)\fR
136 into the file descriptor
141 \f5PROC_SIG_DFL(\fIsig\fP)\fR
142 The signal handler for
146 in the child context.
148 \f5PROC_SIG_IGN(\fIsig\fP)\fR
149 The signal handler for
153 in the child context.
155 \f5PROC_SYS_PGRP(\fIpgid\fP)\fR
156 The child process group is set to
159 may have the following values:
162 The child process becomes a session leader.
165 The child process is in the parent process group.
168 The child process becomes a process group leader.
171 The child process joins the process group
174 \f5PROC_SYS_UMASK(\fImask\fP)\fR
175 The child process group file creation mask is set to
179 is the inclusive-or of the following:
186 This is an optimization that avoids an environment vector
195 setup is done for the child process.
198 Parent process redirection file discriptors are closed on error.
201 Standard daemon setup is done for the child process.
204 The child environment is cleared before
209 The child effective group id is set to the real group id.
212 Parent pipe errors are ignored.
215 The current process is overlayed by
225 is searched using the default standard
227 the child environment variable
229 is set to the default standard;
239 if it is a shell script.
242 If the effective user id is
244 then the child real user id is set to
246 and the child real group id is set to the effective group id.
255 The child process becomes a session group leader.
259 .LR PROC_SYS_PGRP(-1) .)
262 The child effective user id is set to the real user id.
270 The return value is a pointer to a structure with the following members:
273 The child process id.
275 .L "pid_t \fIpgrp\fP"
276 The child process group.
279 A read file descriptor connected to
284 A write file descriptor connected to
288 If an error occurs then
293 waits for the process
295 to complete and then closes the command stream
297 The command exit status is returned.
299 is returned if the child portion of
304 frees the process stream without waiting for
307 Presumably some other mechanism will be used to wait for
317 and returns the command exit status.
319 popen(3), sfpopen(3), spawnveg(3), system(3)