sys_setsid [kernel/sys.c]
Creates a new session if the calling process is not a process group leader and sets the process group and session IDs to the PID of the calling process. Arguments
eax | 66
Return values If the system call succeeds the return value is the session ID of the calling process. If the system call fails the return value is one of the following errno values:
`-EPERM` | `The calling process is already a process group leader.`
Remarks A child created via sys_fork inherits its parent's session ID. The session ID is preserved across an sys_execve. A process group leader is a process with process group ID equal to its PID. In order to be sure that sys_setsid will succeed, sys_fork and sys_exit, and have the child do sys_setsid. Compatibility n/a