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

  man pages->IRIX man pages -> standard/setsid (2)              
Title
Content
Arch
Section
 

Contents


setsid(2)							     setsid(2)


NAME    [Toc]    [Back]

     setsid - set session ID

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <unistd.h>

     pid_t setsid(void);

DESCRIPTION    [Toc]    [Back]

     If	the calling process is not already a process group leader, setsid sets
     the process group ID and session ID of the	calling	process	to the process
     ID	of the calling process,	and releases the process's controlling
     terminal.

     setsid will fail and return an error if the following is true:

     EPERM	    The	calling	process	is already a process group leader, or
		    there are processes	other than the calling process whose
		    process group ID is	equal to the process ID	of the calling
		    process.

SEE ALSO    [Toc]    [Back]

      
      
     intro(2), exec(2),	exit(2), fork(2), getpid(2), getpgid(2), getsid(2),
     setpgid(2), setpgrp, signal(2), sigsend(2), sigaction(2).

NOTES    [Toc]    [Back]

     If	the calling process is the last	member of a pipeline started by	a job
     control shell, the	shell may make the calling process a process group
     leader.  The other	processes of the pipeline become members of that
     process group. In this case, the call to setsid will fail.	 For this
     reason, a process that calls setsid and expects to	be part	of a pipeline
     should always first fork; the parent should exit and the child should
     call setsid, thereby insuring that	the process will work reliably when
     started by	both job control shells	and non-job control shells.

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, setsid	returns	the calling process's session
     ID.  Otherwise, a value of	-1 is returned and errno is set	to indicate
     the error.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
getsid IRIX get session ID
getsid NetBSD get session ID
getsid HP-UX get session ID
getsid Linux get session ID
SSL_set_session NetBSD set a TLS/SSL session to be used during TLS/SSL connect
tt_session_quit HP-UX quit the session
SSL_set_session OpenBSD set a TLS/SSL session to be used during TLS/SSL connect
startx IRIX initialize an X session
xsm IRIX X Session Manager
SSL_set_session Tru64 Set a TLS/SSL session to be used during TLS/SSL connect
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service