*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> setsid (2)              
Title
Content
Arch
Section
 

setsid(2)

Contents


NAME    [Toc]    [Back]

       setsid - Set the process group ID

SYNOPSIS    [Toc]    [Back]

       #include <unistd.h>

       pid_t setsid
               void );

       Application  developers  may  want  to specify an #include
       statement for <sys/types.h> before the one for  <unistd.h>
       if  programs  are  being developed for multiple platforms.
       The additional #include statement is not required on Tru64
       UNIX  systems  or  by  ISO or XSH standards, but may be on
       other vendors' systems that conform to these standards.

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       setsid(): XSH4.0, XSH4.2, XSH5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

DESCRIPTION    [Toc]    [Back]

       The setsid() function creates a new session when the calling
  process  is  not  a process group leader. 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    [Toc]    [Back]

       Upon  successful  completion,  the setsid function returns
       the value of the new process group ID. Otherwise, a  value
       of  (pid_t)-1 is returned and errno is set to indicate the
       error.

ERRORS    [Toc]    [Back]

       The setsid() function sets errno to the  specified  values
       for  the  following  conditions:  The  calling  process is
       already the process group leader, or the process group  ID
       of  another  process matches the process ID of the calling
       process.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: getpid(2), getsid(2), setpgid(2)

       Standards: standards(5)



                                                        setsid(2)
[ Back ]
 Similar pages
Name OS Title
nsg_attach_pid Tru64 Attaches a process to, or detaches a process from a NUMA Scheduling Group (libnuma library)
nsg_detach_pid Tru64 Attaches a process to, or detaches a process from a NUMA Scheduling Group (libnuma library)
pgsignal FreeBSD post signal to a process or process group
gsignal FreeBSD post signal to a process or process group
psignal FreeBSD post signal to a process or process group
pfind OpenBSD find process / process group by number
pgfind OpenBSD find process / process group by number
getpgrp HP-UX get process, process group and parent process ID.
getpid HP-UX get process, process group and parent process ID.
getpgrp2 HP-UX get process, process group and parent process ID.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service