SETSID(2-POSIX) RISC/os Reference Manual SETSID(2-POSIX)
NAME
setsid - create session and set process group ID
SYNOPSIS
#include <sys/types.h>
pidt setsid()
DESCRIPTION
If the calling process is not a process group leader, setsid
creates a new session. The calling process becomes the ses-
sion leader of the new session and the process group leader
of a new process group. The calling process has no control-
ling terminal and the process group ID of the calling pro-
cess is set to the process ID of the calling process. The
calling process is the only process in the new process group
and also the only process in the new session.
RETURN VALUES
Upon successful completion, setsid return the value of the
process group ID of the calling process. Otherwise, -1 is
returned and errno is set to indicate the error.
ERRORS
If the following condition occurs, setsid will fail and set
errno to the corresponding value:
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
exec(2), _exit(2), fork(2), getpid(2), kill(2), setpgid(2),
sigaction(2).
Printed 1/15/91 Page 1