Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)setpgid.2 4.1 (Berkeley) 05/09/85
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)setpgid.2 4.1 (Berkeley) 05/09/85
SETPGRP 2J
C 4 NAME
setpgrp, getpgrp - set/get process group
SYNOPSIS
int getpgrp(pid) setpgrp(pid, pgrp)
cc ... -ljobs
DESCRIPTION
The process group of the specified process is returned by
getpgrp. Setpgrp sets the process group of the specified process
pid to the specified
pgrp. If
pid is zero, then the call applies to the current process.
If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process.
This call is used by csh (1) to create process groups in implementing job control. The TIOCGPGRP and TIOCSPGRP calls described in tty (4) are used to get/set the process group of the control terminal.
See jobs(3) for a general discussion of job control.
"SEE ALSO"
jobs(3), getuid(2), tty(4)
BUGS
The job control facilities are not available in standard version 7 UNIX.
These facilities are still under development and may change in future
releases of the system as better inter-process communication facilities
and support for virtual terminals become available. The options and
specifications of these system calls and even the calls themselves
are thus subject to change.
A system call setpgrp has been implemented in other versions of UNIX which are not widely used outside of Bell Laboratories; these implementations have, in general, slightly different semantics.