1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
4 .\" 2004-12-17, mtk, added description of ptsname_r() + ERRORS
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>
11 .\"WORD: pseudoterminal µ¼»÷üËö
13 .TH PTSNAME 3 2008-09-03 "" "Linux Programmer's Manual"
15 .\"O ptsname, ptsname_r \- get the name of the slave pseudoterminal
17 ptsname, ptsname_r \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Î̾Á°¤ò¼èÆÀ¤¹¤ë
21 .\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
22 .BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) »²¾È */"
24 .B #include <stdlib.h>
26 .BI "char *ptsname(int " fd ");"
28 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
29 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) »²¾È */"
31 .B #include <stdlib.h>
33 .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
39 .\"O function returns the name of the slave pseudoterminal device
40 .\"O corresponding to the master referred to by
45 ¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö (pts) ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë
46 ¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤òÊÖ¤¹¡£
50 .\"O function is the reentrant equivalent of
52 .\"O It returns the name of the slave pseudoterminal device as a
53 .\"O null-terminated string in the buffer pointed to by
57 .\"O argument specifies the number of bytes available in
62 ¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£
63 ¤³¤Î´Ø¿ô¤Ï¡¢¥¹¥ì¡¼¥Öµ¿»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¡¢
64 NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¤Ç
66 ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
70 ¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£
71 .\"O .SH "RETURN VALUE"
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.
81 ¤ÏÀÅŪµ²±Îΰè¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
82 ¤³¤Îµ²±Îΰè¤Ï¤³¤Î¸å¤Î
84 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤¤µ¤ì¤ë¡£
85 ¤³¤Î¥Ý¥¤¥ó¥¿¤ò free ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
86 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
91 .\"O On failure, a nonzero value is returned
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
100 ¥¨¥é¡¼¤Î¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢
102 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
103 .\" ¼ÂºÝ¤Ë¤Ï¡¢errno ¤ÎÃͤ¬´Ø¿ô¤Î·ë²Ì¤ÎÊÖ¤êÃͤȤ·¤Æ¤âÊÖ¤µ¤ì¤ë¡£-- MTK, Dec 04
108 .\"O .RB ( ptsname_r ()
119 .\"O does not refer to a pseudoterminal master device.
121 ¤¬¥Þ¥¹¥¿µ¿»÷üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
124 .\"O .RB ( ptsname_r ()
135 .\"O is provided in glibc since version 2.1.
137 ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
138 .\"O .SH "CONFORMING TO"
141 .\"O is part of the UNIX 98 pseudoterminal support (see
143 .\"O This function is specified in POSIX.1-2001.
145 ¤Ï UNIX 98 µ¿»÷üËö»ÅÍͤΰìÉô¤Ç¤¢¤ë
147 ¤ò»²¾È¤Î¤³¤È)¡£¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
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
154 .\"O set to indicate the error.
155 .\"O Avoid using this function in portable programs.
157 ¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
158 ¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤ÎµºÜ¤¬¤¢¤ë¤â¤Î¤È¤·¤Æ Tru64 ¤È HP-UX ¤¬¤¢¤ë¤¬¡¢
159 ¤³¤ì¤é¤Î OS ¤Ç¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
161 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
162 °Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£
166 .BR posix_openpt (3),