diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-06-24 22:28:35 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-06-24 22:28:35 +0000 |
commit | 3950ffe2a485479f6561c27364d3d7df5a21d124 (patch) | |
tree | 468c6e14449d1b1e279222ec32f676b0311917d2 /src/lib/libast/man/spawnveg.3 | |
download | ksh-upstream.tar.gz |
Imported Upstream version 93u+upstream
Diffstat (limited to 'src/lib/libast/man/spawnveg.3')
-rw-r--r-- | src/lib/libast/man/spawnveg.3 | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/lib/libast/man/spawnveg.3 b/src/lib/libast/man/spawnveg.3 new file mode 100644 index 0000000..3dfd424 --- /dev/null +++ b/src/lib/libast/man/spawnveg.3 @@ -0,0 +1,97 @@ +.fp 5 CW +.de Af +.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2 +.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" +.. +.de aF +.ie \\$3 .ft \\$1 +.el \{\ +.ds ;G \& +.nr ;G \\n(.f +.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" +\\*(;G +.ft \\n(;G \} +.. +.de L +.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de LR +.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de RL +.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de EX \" start example +.ta 1i 2i 3i 4i 5i 6i +.PP +.RS +.PD 0 +.ft 5 +.nf +.. +.de EE \" end example +.fi +.ft +.PD +.RE +.PP +.. +.TH SPAWNVEG 3 +.SH NAME +spawnveg \- process spawn with process group and session control +.SH SYNOPSIS +.L "#include <ast.h>" +.sp +.L "int spawnveg(const char* command, char** argv, char** envv, pid_t pgid);" +.SH DESCRIPTION +.L spwanveg +combines +.IR fork (2), +.IR exec (2), +.IR setpgid (2) +and +.IR setsid (2) +into a single call. +.PP +.LR command , +.L argv +and +.L envv +are as in +.IR execve (2). +.L pgid +controls the new process group and session: +.TP +.L <0 +The new process becomes a session leader. +is called in the child context. +.TP +.L 0 +The new process is in the callers process group. +.TP +.L 1 +The new process becomes a process group leader. +.TP +.L >1 +The new process joins the process group +.IR pgid . +.SH COMMENTS +It is possible to code all process creation (except for +.IR vfork (2) +hack like in +.IR csh (1)) +using +.LR spawnveg . +The +.IR proc (3) +routines and +.IR ksh (1) +do this on systems that don't support +.IR fork (2). +This makes porting to NT and Windows a snap: a simple +.IR iffe (1) +probe provides a +.L spawnveg +implementation using the NT or Windows process primitives. +.SH "SEE ALSO" +fork(2), exec(2), setpgid(2), setsid(2), spawnve(2) |