.\" Hey Emacs! This file is -*- nroff -*- source. .\" This page is in the public domain. - aeb .\" .\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2003-07-08, Akihiro MOTOKI .\" Updated 2005-02-27, Akihiro MOTOKI .\" .\"WORD: pseudo-terminal 擬似端末 .\" .TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual" .\"O .SH NAME .\"O ptsname, ptsname_r \- get the name of the slave pseudo-terminal .SH 名前 ptsname, ptsname_r \- スレーブ擬似端末の名前を取得する .\"O .SH SYNOPSIS .SH 書式 .nf .B #define _XOPEN_SOURCE .br .B #include .sp .BI "char *ptsname(int " fd ");" .sp .B #define _GNU_SOURCE .br .B #include .sp .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");" .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR ptsname () .\"O function returns the name of the slave pseudo-terminal (pty) device .\"O corresponding to the master referred to by .\"O .IR fd . .BR ptsname () 関数は .I fd で参照されるマスタ擬似端末 (pts) デバイスに対応する スレーブ擬似端末デバイスの名前を返す。 .\"O The .\"O .BR ptsname_r () .\"O function is the reentrant equivalent of .\"O .BR ptsname (). .\"O It returns the name of the slave pseudo-terminal device as a .\"O null-terminated string in the buffer pointed to by .\"O .IR buf . .\"O The .\"O .I buflen .\"O argument specifies the number of bytes available in .\"O .IR buf . .BR ptsname_r () 関数は .BR ptsname () のリエントラントなバージョンである。 この関数は、スレーブ疑似端末デバイスの名前を、 NULL で終端された文字列の形で .I buf で指定されたバッファに格納して返す。 .I buflen 引き数には .I buf のバイト数を指定する。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, .\"O .BR ptsname () .\"O returns a pointer to a string in static storage which will be .\"O overwritten by subsequent calls. .\"O This pointer must not be freed. .\"O On failure, a NULL pointer is returned. 成功の場合、 .BR ptsname () は静的記憶領域の文字列へのポインタを返す。 この記憶領域はこの後の .BR ptsname () の呼び出しで上書きされる。 このポインタを free してはいけない。 エラーの場合は NULL ポインタを返す。 .\"O On success, .\"O .BR ptsname_r () .\"O returns 0. .\"O On failure, a nonzero value is returned .\"O and .\"O .I errno .\"O is set to indicate the error. .\"O .\" In fact the errno value is also returned as the function .\"O .\" result -- MTK, Dec 04 成功の場合、 .BR ptsname_r () は 0 を返す。 エラーの場合、0 以外の値を返し、 .I errno をエラーを示す値に設定する。 .\" 実際には、errno の値が関数の結果の返り値としても返される。-- MTK, Dec 04 .\"O .SH ERRORS .SH エラー .TP .B EINVAL .\"O .RB ( ptsname_r () .\"O only) .\"O .I buf .\"O is NULL. .RB ( ptsname_r () のみ) .I buf が NULL である。 .TP .B ENOTTY .\"O .I fd .\"O does not refer to a pseudo-terminal master device. .I fd がマスタ疑似端末デバイスを参照していない。 .TP .B ERANGE .\"O .RB ( ptsname_r () .\"O only) .\"O .I buf .\"O is too small. .RB ( ptsname_r () のみ) .I buf が小さすぎる。 .\"O .SH VERSIONS .SH バージョン .\"O .BR ptsname () .\"O is provided in glibc since version 2.1. .BR ptsname () は、バージョン 2.1 以降の glibc で提供されている。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR ptsname () .\"O is part of the Unix98 pseudo-terminal support (see .\"O .BR pts (4)). .\"O This function is specified in POSIX.1-2001. .BR ptsname () は Unix98 疑似端末仕様の一部である .RB ( pts (4) を参照のこと)。この関数は POSIX.1-2001 で規定されている。 .\"O .BR ptsname_r () .\"O is a Linux extension. .\"O A version of this function is documented on Tru64 and HP-UX, but .\"O on those implementations, \-1 is returned on error, with .\"O .I errno .\"O set to indicate the error. .\"O Avoid using this function in portable programs. .BR ptsname_r () は Linux による拡張である。 この関数についての記載があるものとして Tru64 と HP-UX があるが、 これらの OS での実装ではエラーの場合 \-1 を返し、 .I errno にエラーを示す値を設定する。 移植を考慮したプログラムではこの関数の使用は避けること。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR grantpt (3), .BR posix_openpt (3), .BR ttyname (3), .BR unlockpt (3), .BR pts (4), .BR feature_test_macros (7), .BR pty (7)