Penguin
Annotated edit history of setsid(2) version 4, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 PerryLorier 2 setsid - creates a session and sets the process group ID
1 perry 3
4 !!SYNOPSIS
2 PerryLorier 5 __#include <unistd.h>__
1 perry 6
2 PerryLorier 7 __pid_t setsid(void);__
1 perry 8 !!DESCRIPTION
2 PerryLorier 9 setsid(2) creates a new session if the calling process is not a process group leader. The calling process is the leader of the new session, the process group leader of the new process group, and has no controlling tty. The process group ID and session ID of the calling process are set to the PID of the calling process. The calling process will be the only process in this new process group and in this new session.
1 perry 10
11 !!RETURN VALUE
2 PerryLorier 12 The session ID of the calling process.
1 perry 13
14 !!ERRORS
2 PerryLorier 15 On error, -1 will be returned. The only error which can happen is [EPERM]. It is returned when the process group ID of any process equals the PID of the calling process. Thus, in particular, setsid(2) fails if the calling process is already a process group leader.
1 perry 16
17 !!NOTES
2 PerryLorier 18 A process group leader is a process with process group ID equal to its PID. In order to be sure that setsid(2) will succeed, fork and exit, and have the child do setsid(2).
1 perry 19
20 !!CONFORMING TO
4 JohnMcPherson 21 [POSIX], SVr4.
1 perry 22
23 !!SEE ALSO
3 PerryLorier 24 setpgid(2), setpgrp(2), setsid(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 7 times)