OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / ttyname.3
1 .\" Copyright (c) 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Modified 2001-12-13, Martin Schulze <joey@infodrom.org>
24 .\" Added ttyname_r, aeb, 2002-07-20
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH TTYNAME 3 2008\-07\-14 Linux "Linux Programmer's Manual"
32 .SH 名前
33 ttyname, ttyname_r \- 端末名を返す
34 .SH 書式
35 .nf
36 \fB#include <unistd.h>\fP
37 .sp
38 \fBchar *ttyname(int \fP\fIfd\fP\fB);\fP
39
40 \fBint ttyname_r(int \fP\fIfd\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIbuflen\fP\fB);\fP
41 .fi
42 .SH 説明
43 \fBttyname\fP()  関数は、ファイルディスクリプタ \fIfd\fP がオープンしている端末デバイスの NULL 終端されたパス名へのポインタを返す。
44 エラーが起きたならば NULL を返す (たとえば、\fIfd\fP が端末を参照していないとき)。
45 返り値は静的データを指しているので、次の呼び出しで上書きされる可能性がある。 \fBttyname_r\fP()  関数は、このパス名を長さ
46 \fIbuflen\fP のバッファ \fIbuf\fP に格納する。
47 .SH 返り値
48 \fBttyname\fP()  関数は、成功時はパス名へのポインタを返す。 エラー時は NULL を返し、 \fIerrno\fP が適切に設定される。
49 \fBttyname_r\fP()  関数は、成功時には 0 を返し、エラー時にはエラー番号を返す。
50 .SH エラー
51 \fBttyname_r\fP():
52 .TP 
53 \fBEBADF\fP
54 ファイルディスクリプタが不正。
55 .TP 
56 \fBENOTTY\fP
57 ファイルディスクリプタが端末デバイスを示していない。
58 .TP 
59 \fBERANGE\fP
60 \fIbuflen\fP がパス名を格納するには短すぎる。
61 .SH 準拠
62 4.2BSD, POSIX.1\-2001.
63 .SH 関連項目
64 \fBfstat\fP(2), \fBisatty\fP(3)