HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
s
setpgrp(2) setpgrp(2)
NAME
setpgrp - set process group ID
SYNOPSIS
#include <unistd.h>
pid_t setpgrp(void);
DESCRIPTION
If the calling process is not already a session leader,
setpgrp() sets the process group ID of the calling
process to the process ID of the calling process. If
setpgrp() creates a new session, then the new ses-
sion has no controlling terminal.
The
setpgrp() function has no effect when the calling process is a session leader.
Security Restrictions
Some or all of the actions associated with this system call may require privileges. See privileges(5) for
more information.
RETURN VALUE
Upon successful completion,
setpgrp() returns the new process group ID.
ERRORS
If setpgrp() fails, no changes occur and errno (see errno(2)) is set to one of the following values:
[EPERM] The calling process is already a process group leader or the process group ID of a pro-
cess other than the calling process matches the process ID of the calling process.
[EPERM] The calling process does not have sufficient privileges.
SEE ALSO
exec(2), fork(2), getpid(2), getsid(2), kill(2), setpgrp3(2), setsid(2), privileges(5), <unistd.h>.
STANDARDS CONFORMANCE
setpgrp(): SVID2, SVID3, XPG2, XPG3, XPG4, XPG4.2
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 397