mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 13:22:48 +00:00
Manpage for getsid(2).
This commit is contained in:
parent
4ff76833b4
commit
04b8783cda
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28406
@ -1,5 +1,5 @@
|
||||
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
|
||||
# $Id: Makefile.inc,v 1.35 1997/08/19 06:23:45 peter Exp $
|
||||
# $Id: Makefile.inc,v 1.36 1997/08/19 07:00:53 peter Exp $
|
||||
|
||||
# sys sources
|
||||
.PATH: ${.CURDIR}/../libc/${MACHINE}/sys ${.CURDIR}/../libc/sys
|
||||
@ -96,7 +96,8 @@ MAN2+= sys/accept.2 sys/access.2 sys/acct.2 sys/adjtime.2 sys/bind.2 \
|
||||
sys/getdirentries.2 sys/getdtablesize.2 sys/getfh.2 sys/getfsstat.2 \
|
||||
sys/getgid.2 sys/getgroups.2 sys/getitimer.2 sys/getlogin.2 \
|
||||
sys/getpeername.2 sys/getpgrp.2 sys/getpid.2 sys/getpriority.2 \
|
||||
sys/getrlimit.2 sys/getrusage.2 sys/getsockname.2 sys/getsockopt.2 \
|
||||
sys/getrlimit.2 sys/getrusage.2 sys/getsid.2 \
|
||||
sys/getsockname.2 sys/getsockopt.2 \
|
||||
sys/gettimeofday.2 sys/getuid.2 sys/intro.2 sys/ioctl.2 \
|
||||
sys/issetugid.2 sys/kill.2 \
|
||||
sys/ktrace.2 sys/link.2 sys/listen.2 sys/lseek.2 sys/mkdir.2 \
|
||||
|
77
lib/libc/sys/getsid.2
Normal file
77
lib/libc/sys/getsid.2
Normal file
@ -0,0 +1,77 @@
|
||||
.\" Copyright (c) 1997 Peter Wemm <peter@freebsd.org>
|
||||
.\"
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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$
|
||||
.\"
|
||||
.Dd August 19, 1997
|
||||
.Dt GETSID 2
|
||||
.Os BSD 4.2
|
||||
.Sh NAME
|
||||
.Nm getsid
|
||||
.Nd get process session
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <unistd.h>
|
||||
.Ft pid_t
|
||||
.Fn getsid "pid_t pid"
|
||||
.Sh DESCRIPTION
|
||||
The session ID of the process identified by
|
||||
.Fa pid
|
||||
is returned by
|
||||
.Fn getsid .
|
||||
If
|
||||
.Fa pid
|
||||
is zero,
|
||||
.Fn getsid
|
||||
returns the session ID of the current process.
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion, the function
|
||||
.Fn getsid
|
||||
returns the session ID of
|
||||
the specified process; otherwise, it returns a value of -1 and
|
||||
sets errno to indicate an error.
|
||||
.Sh ERRORS
|
||||
.Fn getsid
|
||||
will succeed unless:
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er ESRCH
|
||||
if there is no process with a process ID equal to
|
||||
.Fa pid .
|
||||
.El
|
||||
.Pp
|
||||
Note that an implementation may restrict this function call to
|
||||
processes within the same session ID as the calling process.
|
||||
.Sh SEE ALSO
|
||||
.Xr getpgrp 2 ,
|
||||
.Xr getpgid 2 ,
|
||||
.Xr setpgid 2 ,
|
||||
.Xr setsid 2 ,
|
||||
.Xr termios 4
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn setsid
|
||||
function call appeared in
|
||||
.Fx 3.0 .
|
||||
The
|
||||
.Fn getsid
|
||||
function call is derived from it's usage in
|
||||
.At V .
|
Loading…
Reference in New Issue
Block a user