setsid(2) CLIX setsid(2)
NAME
setsid - Creates a new session
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <types.h>
pid_t setsid(
void );
DESCRIPTION
If the calling process is not a process group leader, the setsid()
function creates a new session. The calling process then becomes the
session leader of this session, becomes the process leader of the new
process group, and has no controlling terminal. The process group ID of
the calling process is set equal to its process ID. The calling process
becomes the only process in the new process group and the only process in
the new session.
RETURN VALUES
Upon successful completion, the value of the new process group ID is
returned. Otherwise a value of -1 is returned and the global variable
errno is set to indicate the error.
ERRORS
The setsid() function fails if the following is true:
[EPERM] The calling process is already the process group leader, or the
process group ID of a process other than the calling process
matches the process ID of the calling process.
RELATED INFORMATION
Functions: getpid(2), getpgrp(2), getppid(2), fork(2), setpgid(2),
setpgrp(2)
2/94 - Intergraph Corporation 1