OSDN Git Service

a4afb67b146fb0f904d5877f7e614275a853541d
[linuxjm/LDP_man-pages.git] / draft / man3 / ptsname.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
3 .\"
4 .\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS
5 .\"
6 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
7 .\"         all rights reserved.
8 .\" Translated 2003-07-08, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
9 .\" Updated 2005-02-27, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .\" 
11 .\"WORD:        pseudoterminal          擬似端末
12 .\"
13 .TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual"
14 .\"O .SH NAME
15 .\"O ptsname, ptsname_r \- get the name of the slave pseudoterminal
16 .SH 名前
17 ptsname, ptsname_r \- スレーブ擬似端末の名前を取得する
18 .\"O .SH SYNOPSIS
19 .SH 書式
20 .nf
21 .\"O .BR "#define _XOPEN_SOURCE" "       /* See feature_test_macros(7) */"
22 .BR "#define _XOPEN_SOURCE" "       /* feature_test_macros(7) 参照 */"
23 .br
24 .B #include <stdlib.h>
25 .sp
26 .BI "char *ptsname(int " fd ");"
27 .sp
28 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
29 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
30 .br
31 .B #include <stdlib.h>
32 .sp
33 .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
34 .fi
35 .\"O .SH DESCRIPTION
36 .SH 説明
37 .\"O The
38 .\"O .BR ptsname ()
39 .\"O function returns the name of the slave pseudoterminal device
40 .\"O corresponding to the master referred to by
41 .\"O .IR fd .
42 .BR ptsname ()
43 関数は
44 .I fd
45 で参照されるマスタ擬似端末 (pts) デバイスに対応する
46 スレーブ擬似端末デバイスの名前を返す。
47
48 .\"O The
49 .\"O .BR ptsname_r ()
50 .\"O function is the reentrant equivalent of
51 .\"O .BR ptsname ().
52 .\"O It returns the name of the slave pseudoterminal device as a
53 .\"O null-terminated string in the buffer pointed to by
54 .\"O .IR buf .
55 .\"O The
56 .\"O .I buflen
57 .\"O argument specifies the number of bytes available in
58 .\"O .IR buf .
59 .BR ptsname_r ()
60 関数は
61 .BR ptsname ()
62 のリエントラントなバージョンである。
63 この関数は、スレーブ疑似端末デバイスの名前を、
64 NULL で終端された文字列の形で
65 .I buf
66 で指定されたバッファに格納して返す。
67 .I buflen
68 引き数には
69 .I buf
70 のバイト数を指定する。
71 .\"O .SH "RETURN VALUE"
72 .SH 返り値
73 .\"O On success,
74 .\"O .BR ptsname ()
75 .\"O returns a pointer to a string in static storage which will be
76 .\"O overwritten by subsequent calls.
77 .\"O This pointer must not be freed.
78 .\"O On failure, a NULL pointer is returned.
79 成功の場合、
80 .BR ptsname ()
81 は静的記憶領域の文字列へのポインタを返す。
82 この記憶領域はこの後の
83 .BR ptsname ()
84 の呼び出しで上書きされる。
85 このポインタを free してはいけない。
86 エラーの場合は NULL ポインタを返す。
87
88 .\"O On success,
89 .\"O .BR ptsname_r ()
90 .\"O returns 0.
91 .\"O On failure, a nonzero value is returned
92 .\"O and
93 .\"O .I errno
94 .\"O is set to indicate the error.
95 .\"O .\" In fact the errno value is also returned as the function
96 .\"O .\" result -- MTK, Dec 04
97 成功の場合、
98 .BR ptsname_r ()
99 は 0 を返す。
100 エラーの場合、0 以外の値を返し、
101 .I errno
102 をエラーを示す値に設定する。
103 .\" 実際には、errno の値が関数の結果の返り値としても返される。-- MTK, Dec 04
104 .\"O .SH ERRORS
105 .SH エラー
106 .TP
107 .B EINVAL
108 .\"O .RB ( ptsname_r ()
109 .\"O only)
110 .\"O .I buf
111 .\"O is NULL.
112 .RB ( ptsname_r ()
113 のみ)
114 .I buf
115 が NULL である。
116 .TP
117 .B ENOTTY
118 .\"O .I fd
119 .\"O does not refer to a pseudoterminal master device.
120 .I fd
121 がマスタ疑似端末デバイスを参照していない。
122 .TP
123 .B ERANGE
124 .\"O .RB ( ptsname_r ()
125 .\"O only)
126 .\"O .I buf
127 .\"O is too small.
128 .RB ( ptsname_r ()
129 のみ)
130 .I buf
131 が小さすぎる。
132 .\"O .SH VERSIONS
133 .SH バージョン
134 .\"O .BR ptsname ()
135 .\"O is provided in glibc since version 2.1.
136 .BR ptsname ()
137 は、バージョン 2.1 以降の glibc で提供されている。
138 .\"O .SH "CONFORMING TO"
139 .SH 準拠
140 .\"O .BR ptsname ()
141 .\"O is part of the UNIX 98 pseudoterminal support (see
142 .\"O .BR pts (4)).
143 .\"O This function is specified in POSIX.1-2001.
144 .BR ptsname ()
145 は UNIX 98 疑似端末仕様の一部である
146 .RB ( pts (4)
147 を参照のこと)。この関数は POSIX.1-2001 で規定されている。
148
149 .\"O .BR ptsname_r ()
150 .\"O is a Linux extension.
151 .\"O A version of this function is documented on Tru64 and HP-UX, but
152 .\"O on those implementations, \-1 is returned on error, with
153 .\"O .I errno
154 .\"O set to indicate the error.
155 .\"O Avoid using this function in portable programs.
156 .BR ptsname_r ()
157 は Linux による拡張である。
158 この関数についての記載があるものとして Tru64 と HP-UX があるが、
159 これらの OS での実装ではエラーの場合 \-1 を返し、
160 .I errno
161 にエラーを示す値を設定する。
162 移植を考慮したプログラムではこの関数の使用は避けること。
163 .\"O .SH "SEE ALSO"
164 .SH 関連項目
165 .BR grantpt (3),
166 .BR posix_openpt (3),
167 .BR ttyname (3),
168 .BR unlockpt (3),
169 .BR pts (4),
170 .BR pty (7)