setpgrp — set process group ID
If the calling process is not already a session
sets the process group ID of the calling process to the process ID
of the calling process.
creates a new session, then the new session has no controlling terminal.
function has no effect when the calling process is a session leader.
Some or all of the actions associated with this system call may require
for more information.
Upon successful completion,
returns the new process group ID.
fails, no changes occur and
is set to one of the following values:
The calling process is already a process group leader or
the process group ID of a process other than the calling
process matches the process ID of the calling process.
The calling process does not have sufficient privileges.
setpgrp(): SVID2, SVID3, XPG2, XPG3, XPG4, XPG4.2