DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

setpgrp(C)


setpgrp -- set the process group of a program

Syntax

setpgrp command [ arguments ]

Description

setpgrp allows the creation of a new process group with the program command as the process group leader. command must specify its path explicitly if it is not already set in the PATH of the environment of the calling shell. command also retains the controlling terminal, environment, open file descriptors, and signal mask of the calling shell. See execvp(S-osr5) for a full description of the properties that are inherited.

setpgrp allows a given tty, such as a modem port, to become the controlling terminal for command which runs within its own process group as the process group leader. If the connection is broken, processes in command's process group will terminate unless they trap SIGHUP. If the shell that invoked setpgrp exits, a command that traps SIGHUP continues to run as it is within its own process group.

Examples

Set a command that reads from the modem port running in the background over a modem connection (typically, a shell script invoking a program such as uucico(ADM)):

setpgrp uu_script arg1 arg2 &

See also

execvp(S-osr5), kill(C), nice(C), nohup(C), perror(S-osr5), setpgrp(S-osr5), signal(S-osr5)

Standards conformance

setpgrp is conformant with AT&T SVID Issue 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005