OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[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 .B #define _XOPEN_SOURCE
22 .br
23 .B #include <stdlib.h>
24 .sp
25 .BI "char *ptsname(int " fd ");"
26 .sp
27 .B #define _GNU_SOURCE
28 .br
29 .B #include <stdlib.h>
30 .sp
31 .BI "int ptsname_r(int " fd ", char *" buf ", size_t " buflen ");"
32 .fi
33 .\"O .SH DESCRIPTION
34 .SH ÀâÌÀ
35 .\"O The
36 .\"O .BR ptsname ()
37 .\"O function returns the name of the slave pseudoterminal device
38 .\"O corresponding to the master referred to by
39 .\"O .IR fd .
40 .BR ptsname ()
41 ´Ø¿ô¤Ï
42 .I fd
43 ¤Ç»²¾È¤µ¤ì¤ë¥Þ¥¹¥¿µ¼»÷üËö (pts) ¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë
44 ¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤òÊÖ¤¹¡£
45
46 .\"O The
47 .\"O .BR ptsname_r ()
48 .\"O function is the reentrant equivalent of
49 .\"O .BR ptsname ().
50 .\"O It returns the name of the slave pseudoterminal device as a
51 .\"O null-terminated string in the buffer pointed to by
52 .\"O .IR buf .
53 .\"O The
54 .\"O .I buflen
55 .\"O argument specifies the number of bytes available in
56 .\"O .IR buf .
57 .BR ptsname_r ()
58 ´Ø¿ô¤Ï
59 .BR ptsname ()
60 ¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¡£
61 ¤³¤Î´Ø¿ô¤Ï¡¢¥¹¥ì¡¼¥Öµ¿»÷üËö¥Ç¥Ð¥¤¥¹¤Î̾Á°¤ò¡¢
62 NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Î·Á¤Ç
63 .I buf
64 ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤ÆÊÖ¤¹¡£
65 .I buflen
66 °ú¤­¿ô¤Ë¤Ï
67 .I buf
68 ¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£
69 .\"O .SH "RETURN VALUE"
70 .SH ÊÖ¤êÃÍ
71 .\"O On success,
72 .\"O .BR ptsname ()
73 .\"O returns a pointer to a string in static storage which will be
74 .\"O overwritten by subsequent calls.
75 .\"O This pointer must not be freed.
76 .\"O On failure, a NULL pointer is returned.
77 À®¸ù¤Î¾ì¹ç¡¢
78 .BR ptsname ()
79 ¤ÏÀÅŪµ­²±Îΰè¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
80 ¤³¤Îµ­²±Îΰè¤Ï¤³¤Î¸å¤Î
81 .BR ptsname ()
82 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£
83 ¤³¤Î¥Ý¥¤¥ó¥¿¤ò free ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
84 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
85
86 .\"O On success,
87 .\"O .BR ptsname_r ()
88 .\"O returns 0.
89 .\"O On failure, a nonzero value is returned
90 .\"O and
91 .\"O .I errno
92 .\"O is set to indicate the error.
93 .\"O .\" In fact the errno value is also returned as the function
94 .\"O .\" result -- MTK, Dec 04
95 À®¸ù¤Î¾ì¹ç¡¢
96 .BR ptsname_r ()
97 ¤Ï 0 ¤òÊÖ¤¹¡£
98 ¥¨¥é¡¼¤Î¾ì¹ç¡¢0 °Ê³°¤ÎÃͤòÊÖ¤·¡¢
99 .I errno
100 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
101 .\" ¼ÂºÝ¤Ë¤Ï¡¢errno ¤ÎÃͤ¬´Ø¿ô¤Î·ë²Ì¤ÎÊÖ¤êÃͤȤ·¤Æ¤âÊÖ¤µ¤ì¤ë¡£-- MTK, Dec 04
102 .\"O .SH ERRORS
103 .SH ¥¨¥é¡¼
104 .TP
105 .B EINVAL
106 .\"O .RB ( ptsname_r ()
107 .\"O only)
108 .\"O .I buf
109 .\"O is NULL.
110 .RB ( ptsname_r ()
111 ¤Î¤ß)
112 .I buf
113 ¤¬ NULL ¤Ç¤¢¤ë¡£
114 .TP
115 .B ENOTTY
116 .\"O .I fd
117 .\"O does not refer to a pseudoterminal master device.
118 .I fd
119 ¤¬¥Þ¥¹¥¿µ¿»÷üËö¥Ç¥Ð¥¤¥¹¤ò»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
120 .TP
121 .B ERANGE
122 .\"O .RB ( ptsname_r ()
123 .\"O only)
124 .\"O .I buf
125 .\"O is too small.
126 .RB ( ptsname_r ()
127 ¤Î¤ß)
128 .I buf
129 ¤¬¾®¤µ¤¹¤®¤ë¡£
130 .\"O .SH VERSIONS
131 .SH ¥Ð¡¼¥¸¥ç¥ó
132 .\"O .BR ptsname ()
133 .\"O is provided in glibc since version 2.1.
134 .BR ptsname ()
135 ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
136 .\"O .SH "CONFORMING TO"
137 .SH ½àµò
138 .\"O .BR ptsname ()
139 .\"O is part of the UNIX 98 pseudoterminal support (see
140 .\"O .BR pts (4)).
141 .\"O This function is specified in POSIX.1-2001.
142 .BR ptsname ()
143 ¤Ï UNIX 98 µ¿»÷üËö»ÅÍͤΰìÉô¤Ç¤¢¤ë
144 .RB ( pts (4)
145 ¤ò»²¾È¤Î¤³¤È)¡£¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
146
147 .\"O .BR ptsname_r ()
148 .\"O is a Linux extension.
149 .\"O A version of this function is documented on Tru64 and HP-UX, but
150 .\"O on those implementations, \-1 is returned on error, with
151 .\"O .I errno
152 .\"O set to indicate the error.
153 .\"O Avoid using this function in portable programs.
154 .BR ptsname_r ()
155 ¤Ï Linux ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
156 ¤³¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Îµ­ºÜ¤¬¤¢¤ë¤â¤Î¤È¤·¤Æ Tru64 ¤È HP-UX ¤¬¤¢¤ë¤¬¡¢
157 ¤³¤ì¤é¤Î OS ¤Ç¤Î¼ÂÁõ¤Ç¤Ï¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
158 .I errno
159 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
160 °Ü¿¢¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤Î´Ø¿ô¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£
161 .\"O .SH "SEE ALSO"
162 .SH ´ØÏ¢¹àÌÜ
163 .BR grantpt (3),
164 .BR posix_openpt (3),
165 .BR ttyname (3),
166 .BR unlockpt (3),
167 .BR pts (4),
168 .BR feature_test_macros (7),
169 .BR pty (7)