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

  man pages->HP-UX 11i man pages -> setsid (2)              
Title
Content
Arch
Section
 

Contents


 setsid(2)                                                         setsid(2)




 NAME    [Toc]    [Back]
      setsid - create session and set process group ID

 SYNOPSIS    [Toc]    [Back]
      #include <unistd.h>

      pid_t setsid(void);

 DESCRIPTION    [Toc]    [Back]
      If the calling process is not a process group leader, setsid() creates
      a new session.  The calling process becomes the session leader of this
      new session, it becomes the process group leader of a new process
      group, and it has no 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 VALUE    [Toc]    [Back]
      Upon successful completion, setsid() returns the value of the new
      process group ID of the calling process.  Otherwise, it returns a
      value of -1, and sets errno to indicate the error.

 ERRORS    [Toc]    [Back]
      If setsid() fails, no changes occur and errno (see errno(2)) is set to
      one of the following values:

           [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.

 AUTHOR    [Toc]    [Back]
      setsid() was developed by HP and AT&T.

 SEE ALSO    [Toc]    [Back]
      exec(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2), setpgrp(2),
      setpgrp3(2), signal(2), termio(7).

 STANDARDS CONFORMANCE    [Toc]    [Back]
      setsid(): AES, SVID3, XPG3, XPG4, XPG4.2, FIPS 151-2, POSIX.1


 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
setpgrp3 HP-UX create session and set process group ID; for HP-UX 9.x compatibility.
setsid Linux creates a session and sets the process group ID
sproc IRIX create a new share group process
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)
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
pgsignal FreeBSD post signal to a process or process group
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service