SETPGRP(S) XENIX System V SETPGRP(S)
Name
setpgrp - Sets process group ID.
Syntax
int setpgrp ()
Description
setpgrp sets the process group ID of the calling process to
the process ID of the calling process and returns the new
process group ID.
There are many ramifications to be considered before
invoking setpgrp. When a process is made a process group
leader with setpgrp, the terminal that controlled the
process that issued the setpgrp statement is lost as the
controlling terminal for the new process group. The new
process group takes as its controlling terminal the next
terminal it opens that is not already open. All child
processes of the new process group leader are controlled by
the new controlling terminal.
The controlling terminal is responsible for signals (INTR,
KILL, EOF) sent to the process group leader and it child
processes. If there is no controlling terminal, it becomes
more difficult to interrupt a process.
As an example, setpgrp is used to separate daemon processes
from controlling terminals so that they may not be
interrupted from any terminal by a KILL or INTR signal.
Return Value
setpgrp returns the value of the new process group ID.
See Also
exec(S), fork(S), getpid(S), intro(S), kill(S), signal(S),
termio(M)
Page 1 (printed 8/7/87)