OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[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)