OSDN Git Service

2401cf7992b856fee4e38826bca965c2c3ee6ffe
[linuxjm/LDP_man-pages.git] / draft / man3 / tcgetsid.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
24 .\"         all rights reserved.
25 .\" Translated Sat Jul 19 03:06:35 JST 2003
26 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .\"
28 .TH TCGETSID 3 2010-09-10 "GNU" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .\"O tcgetsid \- get session ID
31 .SH 名前
32 tcgetsid \- セッションID を取得する
33 .\"O .SH SYNOPSIS
34 .SH 書式
35 .nf
36 .\"O .BR "#define _XOPEN_SOURCE 500" "        /* See feature_test_macros(7) */"
37 .BR "#define _XOPEN_SOURCE 500" "        /* feature_test_macros(7) 参照 */"
38 .br
39 .B "#include <termios.h>"
40 .sp
41 .BI "pid_t tcgetsid(int " fd );
42 .fi
43 .\"O .SH DESCRIPTION
44 .SH 説明
45 .\"O The function
46 .\"O .BR tcgetsid ()
47 .\"O returns the session ID of the current session that has the
48 .\"O terminal associated to
49 .\"O .I fd
50 .\"O as controlling terminal.
51 .\"O This terminal must be the controlling terminal of the calling process.
52 関数
53 .BR tcgetsid ()
54 は、制御端末として
55 .I fd
56 に対応する端末を持つカレント・セッションのセッションID を返す。
57 この端末は \fBtcgetsid\fR() の呼び出しを行うプロセスの制御端末で
58 なければならない。
59 .\"O .SH "RETURN VALUE"
60 .SH 返り値
61 .\"O When
62 .\"O .I fd
63 .\"O refers to the controlling terminal of our session,
64 .\"O the function
65 .\"O .BR tcgetsid ()
66 .\"O will return the session ID of this session.
67 .I fd
68 が呼び出しを行ったセッションの制御端末を参照している場合、
69 関数
70 .BR tcgetsid ()
71 はこのセッションのセッションID を返す。
72 .\"O Otherwise, \-1 is returned, and
73 .\"O .I errno
74 .\"O is set appropriately.
75 そうでない場合、 \-1 が返され、
76 .I errno
77 が適切に設定される。
78 .\"O .SH ERRORS
79 .SH エラー
80 .TP
81 .B EBADF
82 .\"O .I fd
83 .\"O is not a valid file descriptor.
84 .I fd
85 は有効なファイル記述子でない。
86 .TP
87 .B ENOTTY
88 .\"O The calling process does not have a controlling terminal, or
89 .\"O it has one but it is not described by
90 .\"O .IR fd .
91 呼び出しを行ったプロセスが制御端末を持っていない、もしくは
92 制御端末を持っているが
93 .I fd
94 で参照されるものとは異なる。
95 .\"O .SH VERSIONS
96 .SH バージョン
97 .\"O .BR tcgetsid ()
98 .\"O is provided in glibc since version 2.1.
99 .BR tcgetsid ()
100 は、バージョン 2.1 以降の glibc で提供されている。
101 .\"O .SH "CONFORMING TO"
102 .SH 準拠
103 POSIX.1-2001.
104 .\"O .SH NOTES
105 .SH 注意
106 .\"O This function is implemented via the
107 .\"O .B TIOCGSID
108 .\"O .BR ioctl (2),
109 .\"O present
110 .\"O since Linux 2.1.71.
111 この関数は
112 .B TIOCGSID
113 .BR ioctl (2)
114 経由で実現されており、
115 Linux 2.1.71 以降で存在する。
116 .\"O .SH "SEE ALSO"
117 .SH 関連項目
118 .BR getsid (2)