SETSID
Section: Misc. Reference Manual Pages (2P)
Updated: August 1, 1992
Index
Return to Main Contents
NAME
setsid - (POSIX only) create session and set process group ID
SYNOPSIS
#include <sys/types.h>
pid_t setsid(void);
DESCRIPTION
The information in this specification applies
only to POSIX applications.
If the calling process is not a process group leader, the
setsid
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.
RETURN VALUE
A successful call to
setsid
returns the value of the process group ID of the calling
process.
A value of -1 indicates that an error occurred, and the error
code is stored in the global variable errno.
ERRORS
A possible error for setsid is:
- [EPERM]
-
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.
SEE ALSO
execve(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2P),
sigaction(2P)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 00:59:06 GMT, September 26, 2024