.\" Translated 2003-07-08, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-02-27, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
-.\"WORD: pseudoterminal µ¼»÷üËö
+.\"WORD: pseudoterminal 擬似端末
.\"
.TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual"
.\"O .SH NAME
.\"O ptsname, ptsname_r \- get the name of the slave pseudoterminal
-.SH ̾Á°
-ptsname, ptsname_r \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î̾Á°¤ò¼èÆÀ¤¹¤ë
+.SH 名前
+ptsname, ptsname_r \- スレーブ擬似端末の名前を取得する
.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.SH 書式
.nf
.\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
-.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) »²¾È */"
+.BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */"
.br
.B #include <stdlib.h>
.sp
.BI "char *ptsname(int " fd ");"
.sp
.\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
-.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
+.BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */"
.br
.B #include <stdlib.h>
.sp
.BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
.fi
.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
+.SH 説明
.\"O The
.\"O .BR ptsname ()
.\"O function returns the name of the slave pseudoterminal device
.\"O corresponding to the master referred to by
.\"O .IR fd .
.BR ptsname ()
-´Ø¿ô¤Ï
+関数は
.I fd
-¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö (pts) ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë
-¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤òÊÖ¤¹¡£
+で参照されるマスタ擬似端末 (pts) デバイスに対応する
+スレーブ擬似端末デバイスの名前を返す。
.\"O The
.\"O .BR ptsname_r ()
.\"O argument specifies the number of bytes available in
.\"O .IR buf .
.BR ptsname_r ()
-´Ø¿ô¤Ï
+関数は
.BR ptsname ()
-¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£
-¤³¤Î´Ø¿ô¤Ï¡¢¥¹¥ì¡¼¥Öµ¿»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¡¢
-NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¤Ç
+のリエントラントなバージョンである。
+この関数は、スレーブ疑似端末デバイスの名前を、
+NULL で終端された文字列の形で
.I buf
-¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
+で指定されたバッファに格納して返す。
.I buflen
-°ú¤¿ô¤Ë¤Ï
+引き数には
.I buf
-¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£
+のバイト数を指定する。
.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
+.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 ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
+の呼び出しで上書きされる。
+このポインタを free してはいけない。
+エラーの場合は NULL ポインタを返す。
.\"O On success,
.\"O .BR ptsname_r ()
.\"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 °Ê³°¤ÎÃͤòÊÖ¤·¡¢
+は 0 を返す。
+エラーの場合、0 以外の値を返し、
.I errno
-¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
-.\" ¼ÂºÝ¤Ë¤Ï¡¢errno ¤ÎÃͤ¬´Ø¿ô¤Î·ë²Ì¤ÎÊÖ¤êÃͤȤ·¤Æ¤âÊÖ¤µ¤ì¤ë¡£-- MTK, Dec 04
+をエラーを示す値に設定する。
+.\" 実際には、errno の値が関数の結果の返り値としても返される。-- MTK, Dec 04
.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
+.SH ã\82¨ã\83©ã\83¼
.TP
.B EINVAL
.\"O .RB ( ptsname_r ()
.\"O .I buf
.\"O is NULL.
.RB ( ptsname_r ()
-¤Î¤ß)
+のみ)
.I buf
-¤¬ NULL ¤Ç¤¢¤ë¡£
+が NULL である。
.TP
.B ENOTTY
.\"O .I fd
.\"O does not refer to a pseudoterminal master device.
.I fd
-¤¬¥Þ¥¹¥¿µ¿»÷üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
+がマスタ疑似端末デバイスを参照していない。
.TP
.B ERANGE
.\"O .RB ( ptsname_r ()
.\"O .I buf
.\"O is too small.
.RB ( ptsname_r ()
-¤Î¤ß)
+のみ)
.I buf
-¤¬¾®¤µ¤¹¤®¤ë¡£
+が小さすぎる。
.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
+.SH バージョン
.\"O .BR ptsname ()
.\"O is provided in glibc since version 2.1.
.BR ptsname ()
-¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
+は、バージョン 2.1 以降の glibc で提供されている。
.\"O .SH "CONFORMING TO"
-.SH ½àµò
+.SH 準拠
.\"O .BR ptsname ()
.\"O is part of the UNIX 98 pseudoterminal support (see
.\"O .BR pts (4)).
.\"O This function is specified in POSIX.1-2001.
.BR ptsname ()
-¤Ï UNIX 98 µ¿»÷üËö»ÅÍͤΰìÉô¤Ç¤¢¤ë
+は UNIX 98 疑似端末仕様の一部である
.RB ( pts (4)
-¤ò»²¾È¤Î¤³¤È)¡£¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
+を参照のこと)。この関数は POSIX.1-2001 で規定されている。
.\"O .BR ptsname_r ()
.\"O is a Linux extension.
.\"O set to indicate the error.
.\"O Avoid using this function in portable programs.
.BR ptsname_r ()
-¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
-¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤ÎµºÜ¤¬¤¢¤ë¤â¤Î¤È¤·¤Æ Tru64 ¤È HP-UX ¤¬¤¢¤ë¤¬¡¢
-¤³¤ì¤é¤Î OS ¤Ç¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
+は Linux による拡張である。
+この関数についての記載があるものとして Tru64 と HP-UX があるが、
+これらの OS での実装ではエラーの場合 \-1 を返し、
.I errno
-¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
-°Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£
+にエラーを示す値を設定する。
+移植を考慮したプログラムではこの関数の使用は避けること。
.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.SH 関連項目
.BR grantpt (3),
.BR posix_openpt (3),
.BR ttyname (3),