unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

SETSID(2V)                                                          SETSID(2V)



NAME
       setsid - create session and set process group ID

SYNOPSIS
       #include <&lt;sys/types.h>&gt;

       pid_t setsid()

DESCRIPTION
       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  this new session, the process group leader of a new process
       group, and has no controlling terminal.  If the process had a  control-
       ling  terminal, setsid() breaks the association between the process and
       that controlling terminal.  The process group ID of the calling process
       is  set  equal  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 VALUES
       setsid()  returns  the  process group ID of the calling process on suc-
       cess.  On failure, it returns -1 and sets errno to indicate the error.

ERRORS
       If any of the following conditions occur, setsid() returns -1 and  sets
       errno to the corresponding value:

       EPERM          The calling process is already a process group leader.

                      The process ID of the calling process equals the process
                      group ID of a different process.

SEE ALSO
       execve(2V),  exit(2V),  fork(2V),  getpid(2V),  getpgrp(2V),  kill(2V),
       setpgid(2V), sigaction(3V)



                                21 January 1990                     SETSID(2V)