.\" Copyright (C) 2002 Andries Brouwer .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI .\" all rights reserved. .\" Translated Sat Jul 19 03:06:35 JST 2003 .\" by Akihiro MOTOKI .\" .TH TCGETSID 3 2014\-01\-13 GNU "Linux Programmer's Manual" .SH 名前 tcgetsid \- セッションID を取得する .SH 書式 \fB#define _XOPEN_SOURCE 500\fP /* feature_test_macros(7) 参照 */ .br \fB#include \fP .sp \fBpid_t tcgetsid(int \fP\fIfd\fP\fB);\fP .SH 説明 関数 \fBtcgetsid\fP() は、制御端末として \fIfd\fP に対応する端末を持つカレントセッションのセッションID を返す。 この端末は \fBtcgetsid\fP() の呼び出しを行うプロセスの制御端末で なければならない。 .SH 返り値 \fIfd\fP が呼び出しを行ったセッションの制御端末を参照している場合、 関数 \fBtcgetsid\fP() はこのセッションのセッションID を返す。 そうでない場合、 \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEBADF\fP \fIfd\fP が有効なファイルディスクリプターではない。 .TP \fBENOTTY\fP 呼び出しを行ったプロセスが制御端末を持っていない、もしくは 制御端末を持っているが \fIfd\fP で参照されるものとは異なる。 .SH バージョン \fBtcgetsid\fP() は、バージョン 2.1 以降の glibc で提供されている。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBtcgetsid\fP() 関数はスレッドセーフではない。 .SH 準拠 POSIX.1\-2001. .SH 注意 この関数は \fBTIOCGSID\fP \fBioctl\fP(2) 経由で実現されており、 Linux 2.1.71 以降で存在する。 .SH 関連項目 \fBgetsid\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。