doc/documentation/manual-pages/ja/man2/getsid.2
Sergio Carlavilla Delgado 989d921f5d Migrate doc to Hugo/AsciiDoctor
I'm very pleased to announce the release of
our new website and documentation using
the new toolchain with Hugo and AsciiDoctor.

To get more information about the new toolchain
please read the FreeBSD Documentation Project Primer[1],
Hugo docs[2] and AsciiDoctor docs[3].

Acknowledgment:
Benedict Reuschling <bcr@>
Glen Barber <gjb@>
Hiroki Sato <hrs@>
Li-Wen Hsu <lwhsu@>
Sean Chittenden <seanc@>
The FreeBSD Foundation

[1] https://docs.FreeBSD.org/en/books/fdp-primer/
[2] https://gohugo.io/documentation/
[3] https://docs.asciidoctor.org/home/

Approved by:    doceng, core
2021-01-26 00:31:29 +01:00

81 lines
2.4 KiB
Groff

.\" 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.
.\"
.\" %FreeBSD: src/lib/libc/sys/getsid.2,v 1.10 2002/12/18 09:22:30 ru Exp %
.\"
.\" $FreeBSD$
.Dd August 19, 1997
.Dt GETSID 2
.Os
.Sh 名称
.Nm getsid
.Nd プロセスセッションを得る
.Sh ライブラリ
.Lb libc
.Sh 書式
.In unistd.h
.Ft pid_t
.Fn getsid "pid_t pid"
.Sh 解説
.Fn getsid
.Fa pid
によって識別されるプロセスのセッション ID を返します。
.Fa pid
が 0 の場合、
.Fn getsid
は現在のプロセスのセッション ID を返します。
.Sh 戻り値
処理が正常に完了すると、
.Fn getsid
システムコールは指定されたプロセスのセッション ID を返します。
そうでない場合は値 -1 が返され、エラーを示すために
.Fa errno
が設定されます。
.Sh エラー
.Fn getsid
システムコールは次の場合を除いて正常に完了します:
.Bl -tag -width Er
.It Bq Er ESRCH
.Fa pid
で指定されたプロセス ID を持つプロセスがない場合
.El
.Pp
実装によっては、このシステムコールを呼び出しプロセスと
同じセッション ID を持つプロセスに制限する可能性が
あることに注意してください。
.Sh 関連項目
.Xr getpgid 2 ,
.Xr getpgrp 2 ,
.Xr setpgid 2 ,
.Xr setsid 2 ,
.Xr termios 4
.Sh 歴史
.Fn getsid
システムコールは
.Fx 3.0
ではじめて登場しました。
.Fn getsid
システムコールは
.At V
での使用法に由来しています。