Manual page for SETSID(2P)
setsid - (POSIX only) create session and set process group ID
The information in this specification applies
only to POSIX applications.
If the calling process is not a process group leader, the
function creates a new session. The calling process is the
session leader of the new session, the process group leader of
a new process group, and has no controlling terminal.
The process group ID of the calling process is set to the
process ID of the calling process. The calling process is
the only process in the new process group and the only process
in the new session.
A successful call to
returns the value of the process group ID of the calling
A value of -1 indicates that an error occurred, and the error
code is stored in the global variable errno.
A possible error for setsid is:
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.
execve(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2P),
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97