Home | History | Annotate | Line # | Download | only in sys
setsid.2 revision 1.1
 Copyright (c) 1994 Winning Strategies, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by Winning Strategies, Inc.
4. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

$Id: setsid.2,v 1.1 1994/04/15 22:48:03 jtc Exp $

.Dd April 15, 1994 .Dt SETSID 2 .Os .Sh NAME .Nm setsid .Nd set session ID .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <unistd.h> .Ft pid_t .Fn setsid .Sh DESCRIPTION If the current process is not a process group leader, .Fn setsid sets the process group ID and the session ID of the current process to the process ID of the current process, and releases the process's controlling terminal. .Sh RETURN VALUES Upon successful completion, the session ID of the current process is returned. Otherwise, a value of (pid_t) -1 is returned and .Va errno is set to indicate the error. .Sh ERRORS .Fn setsid will fail and return an error if the following is true: l -tag -width Er t Bq Er EPERM The current process is already a process group leader, or there are other processes whose process group ID is equal to the process ID of the current process. .El .Sh SEE ALSO .Xr getpid 2 , .Xr setpgid 2 .Sh STANDARDS .Fn setsid is expected to conform to .St -p1003.1-90 .