summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-08-19 07:19:43 +0000
committerpeter <peter@FreeBSD.org>1997-08-19 07:19:43 +0000
commit3197c9d2cb7b87f573bd4a5f56ebbcc9ad994429 (patch)
treee49533aef76e860da33fbe77521ffcf3e008d9d1
parentb40bf7afa234c2c3004ea892d3805a4a7a21ff02 (diff)
downloadFreeBSD-src-3197c9d2cb7b87f573bd4a5f56ebbcc9ad994429.zip
FreeBSD-src-3197c9d2cb7b87f573bd4a5f56ebbcc9ad994429.tar.gz
Manpage for getsid(2).
-rw-r--r--lib/libc/sys/Makefile.inc5
-rw-r--r--lib/libc/sys/getsid.277
2 files changed, 80 insertions, 2 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 60056df..d074a87 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -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 \
diff --git a/lib/libc/sys/getsid.2 b/lib/libc/sys/getsid.2
new file mode 100644
index 0000000..a1bb999
--- /dev/null
+++ b/lib/libc/sys/getsid.2
@@ -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 .
OpenPOWER on IntegriCloud