.\" Copyright (C) 2002 Andries Brouwer .\" .\" 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. .\" .\" 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 2008-06-14 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .\"O tcgetsid \- get session ID .SH 名前 tcgetsid \- セッションID を取得する .\"O .SH SYNOPSIS .SH 書式 .B #define _XOPEN_SOURCE 500 .br .B "#include " .sp .BI "pid_t tcgetsid(int " fd ); .\"O .SH DESCRIPTION .SH 説明 .\"O The function .\"O .BR tcgetsid () .\"O returns the session ID of the current session that has the .\"O terminal associated to .\"O .I fd .\"O as controlling terminal. .\"O This terminal must be the controlling terminal of the calling process. 関数 .BR tcgetsid () は、制御端末として .I fd に対応する端末を持つカレント・セッションのセッションID を返す。 この端末は \fBtcgetsid\fR() の呼び出しを行うプロセスの制御端末で なければならない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O When .\"O .I fd .\"O refers to the controlling terminal of our session, .\"O the function .\"O .BR tcgetsid () .\"O will return the session ID of this session. .I fd が呼び出しを行ったセッションの制御端末を参照している場合、 関数 .BR tcgetsid () はこのセッションのセッションID を返す。 .\"O Otherwise, \-1 is returned, and .\"O .I errno .\"O is set appropriately. そうでない場合、 \-1 が返され、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EBADF .\"O .I fd .\"O is not a valid file descriptor. .I fd は有効なファイル記述子でない。 .TP .B ENOTTY .\"O The calling process does not have a controlling terminal, or .\"O it has one but it is not described by .\"O .IR fd . 呼び出しを行ったプロセスが制御端末を持っていない、もしくは 制御端末を持っているが .I fd で参照されるものとは異なる。 .\"O .SH VERSIONS .SH バージョン .\"O .BR tcgetsid () .\"O is provided in glibc since version 2.1. .BR tcgetsid () は、バージョン 2.1 以降の glibc で提供されている。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O This function is implemented via the .\"O .B TIOCGSID .\"O .BR ioctl (2), .\"O present .\"O since Linux 2.1.71. この関数は .B TIOCGSID .BR ioctl (2) 経由で実現されており、 Linux 2.1.71 以降で存在する。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR getsid (2)