The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 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 session has no controlling terminal.

The setpgrp() function has no effect when the calling process is a session leader.

 RETURN VALUE

Upon completion, setpgrp() returns the process group ID.

 ERRORS

No errors are defined.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

exec, fork(), getpid(), getsid(), kill(), setsid(), <unistd.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]