xref: /titanic_50/usr/src/lib/libast/common/man/spawnveg.3 (revision bfed486ad8de8b8ebc6345a8e10accae08bf2f45)
.fp 5 CW .. .nr ;G \\n(.f .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" \\*(;G .. .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" ..

0

..

..

SPAWNVEG 3
NAME
spawnveg - process spawn with process group and session control
SYNOPSIS
.L "#include <ast.h>" .L "int spawnveg(const char* command, char** argv, char** envv, pid_t pgid);"
DESCRIPTION
.L spwanveg combines fork (2), exec (2), setpgid (2) and setsid (2) into a single call.

.LR command , .L argv and .L envv are as in execve (2). .L pgid controls the new process group and session:

.L <0 The new process becomes a session leader. is called in the child context.

.L 0 The new process is in the callers process group.

.L 1 The new process becomes a process group leader.

.L >1 The new process joins the process group pgid .

COMMENTS
It is possible to code all process creation (except for vfork (2) hack like in csh (1)) using .LR spawnveg . The proc (3) routines and ksh (1) do this on systems that don't support fork (2). This makes porting to NT and Windows a snap: a simple iffe (1) probe provides a .L spawnveg implementation using the NT or Windows process primitives.
"SEE ALSO"
fork(2), exec(2), setpgid(2), setsid(2), spawnve(2)