OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / stdio_ext.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI all rights reserved.
24 .\" Translated Nov 2 2002 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
25 .TH STDIO_EXT 3 2001-12-16 "" "Linux Programmer's Manual"
26 .\"O .SH NAME
27 .SH Ì¾Á°
28 .\"O __fbufsize, __flbf, __fpending, __fpurge, __freadable,
29 .\"O __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \-
30 .\"O interfaces to stdio FILE structure
31 __fbufsize, __flbf, __fpending, __fpurge, __freadable,
32 __freading, __fsetlocking, __fwritable, __fwriting, _flushlbf \-
33 ɸ½àÆþ½ÐÎÏ¥Õ¥¡¥¤¥ë¹½Â¤ÂΤؤΥ¤¥ó¥¿¥Õ¥§¡¼¥¹
34 .\"O .SH SYNOPSIS
35 .SH ½ñ¼°
36 .B #include <stdio.h>
37 .br
38 .B #include <stdio_ext.h>
39 .sp
40 .BI "size_t __fbufsize(FILE *" stream );
41 .br
42 .BI "size_t __fpending(FILE *" stream );
43 .br
44 .BI "int __flbf(FILE *" stream );
45 .br
46 .BI "int __freadable(FILE *" stream );
47 .br
48 .BI "int __fwritable(FILE *" stream );
49 .br
50 .BI "int __freading(FILE *" stream );
51 .br
52 .BI "int __fwriting(FILE *" stream );
53 .br
54 .BI "int __fsetlocking(FILE *" stream ", int " type );
55 .br
56 .B "void _flushlbf(void);"
57 .br
58 .BI "void __fpurge(FILE *" stream );
59 .\"O .SH DESCRIPTION
60 .SH ÀâÌÀ
61 .\"O Solaris introduced routines to allow portable access to the
62 .\"O internals of the
63 .\"O .I FILE
64 .\"O structure, and glibc also implemented these.
65 Solaris ¤Ç¤Ï¡¢
66 .I FILE
67 ¹½Â¤ÂΤÎÆâÉô¤Ø¥Ý¡¼¥¿¥Ö¥ë¤Ê¤«¤¿¤Á¤Ç
68 ¥¢¥¯¥»¥¹¤Ç¤­¤ë¼êÃʤ¬Æ³Æþ¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤ì¤é¤Ï glibc ¤Ç¤â¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
69 .LP
70 .\"O The
71 .\"O .BR __fbufsize ()
72 .\"O function returns the size of the buffer currently used
73 .\"O by the given stream.
74 .BR __fbufsize ()
75 ´Ø¿ô¤Ï¡¢»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤òÊÖ¤¹¡£
76 .LP
77 .\"O The
78 .\"O .BR __fpending ()
79 .\"O function returns the number of bytes in the output buffer.
80 .\"O For wide-oriented streams the unit is wide characters.
81 .\"O This function is undefined on buffers in reading mode,
82 .\"O or opened read-only.
83 .BR __fpending ()
84 ´Ø¿ô¤Ï¡¢½ÐÎϥХåե¡¤ËÆþ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
85 ¥ï¥¤¥É¥­¥ã¥é¥¯¥¿¤ò°·¤¦¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¡¢¥ï¥¤¥É¥­¥ã¥é¥¯¥¿Ã±°Ì¤Ç·×»»¤µ¤ì¤ë¡£
86 ¥Ð¥Ã¥Õ¥¡¤¬Æɤ߽Ф·¥â¡¼¥É¤Î¾ì¹ç¤äÆɤ߽Ф·ÀìÍѤdz«¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Î
87 ¤³¤Î´Ø¿ô¤Î¿¶Éñ¤¤¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
88 .LP
89 .\"O The
90 .\"O .BR __flbf ()
91 .\"O function returns a nonzero value if the stream is line-buffered,
92 .\"O and zero otherwise.
93 .BR __flbf ()
94 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡¤Î¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢
95 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
96 .LP
97 .\"O The
98 .\"O .BR __freadable ()
99 .\"O function returns a nonzero value if the stream allows reading,
100 .\"O and zero otherwise.
101 .BR __freadable ()
102 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢
103 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
104 .LP
105 .\"O The
106 .\"O .BR __fwritable ()
107 .\"O function returns a nonzero value if the stream allows writing,
108 .\"O and zero otherwise.
109 .BR __fwritable ()
110 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ß²Äǽ¤Ê¾ì¹ç¤Ï 0 °Ê³°¤ò¡¢
111 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
112 .LP
113 .\"O The
114 .\"O .BR __freading ()
115 .\"O function returns a nonzero value if the stream is read-only, or
116 .\"O if the last operation on the stream was a read operation,
117 .\"O and zero otherwise.
118 .BR __freading ()
119 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬Æɤ߽Ф·ÀìÍѤξì¹ç¡¢¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬
120 Æɤ߽Ф·Áàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
121 .LP
122 .\"O The
123 .\"O .BR __fwriting ()
124 .\"O function returns a nonzero value if the stream is write-only (or
125 .\"O append-only), or if the last operation on the stream was a write
126 .\"O operation, and zero otherwise.
127 .BR __fwriting ()
128 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤¬½ñ¤­¹þ¤ßÀìÍÑ(¤â¤·¤¯¤ÏÄɲÃÀìÍÑ)¤Î¾ì¹ç¡¢
129 ¤Þ¤¿¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ëľÁ°¤ÎÁàºî¤¬½ñ¤­¹þ¤ßÁàºî¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤·¡¢
130 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
131 .LP
132 .\"O The
133 .\"O .BR __fsetlocking ()
134 .\"O function can be used to select the desired type of locking on the stream.
135 .\"O It returns the current type.
136 .\"O The
137 .\"O .I type
138 .\"O argument can take the following three values:
139 .BR __fsetlocking ()
140 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯·Á¼°¤òÁªÂò¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤ë¡£
141 ÊÖ¤êÃͤϡ¢¸½ºß¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£
142 .I type
143 °ú¤­¿ô¤Ï°Ê²¼¤Î 3 ¼ïÎà¤ÎÃͤò¤È¤ë¤³¤È¤¬¤Ç¤­¤ë :
144 .TP
145 .B FSETLOCKING_INTERNAL
146 .\"O Perform implicit locking around every operation on the given stream
147 .\"O (except for the *_unlocked ones).
148 .\"O This is the default.
149 »ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤ÆÁàºî¤¬¹Ô¤ï¤ì¤ëÅ٤ˡ¢Áàºî¤ÎÁ°¸å¤Ç
150 ÌÀ¼¨Åª¤Ë»Ø¼¨¤·¤Ê¤¯¤Æ¤â¥¹¥È¥ê¡¼¥à¤Î¥í¥Ã¥¯½èÍý¤ò¹Ô¤¦
151 (⤷¡¢*_unlocked ´Ø¿ô¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÏÎã³°¤Ç¤¢¤ë)¡£
152 ¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥í¥Ã¥¯·Á¼°¤Ç¤¢¤ë¡£
153 .TP
154 .B FSETLOCKING_BYCALLER
155 .\"O The caller will take care of the locking (possibly using
156 .\"O .BR flockfile (3)
157 .\"O in case there is more than one thread), and the stdio routines
158 .\"O will not do locking until the state is reset to
159 .\"O .BR FSETLOCKING_INTERNAL .
160 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¸µ¤Ç¥í¥Ã¥¯¤ÎÌÌÅݤò¤ß¤ë¡£
161 (¤ª¤½¤é¤¯¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬Â¸ºß¤¹¤ë¾õ¶·¤Ç¤Ï
162 .BR flockfile (3)
163 ¤ò»È¤¦¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦)
164 ¥í¥Ã¥¯·Á¼°¤¬
165 .B FSETLOCKING_INTERNAL
166 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¤Þ¤Ç¤Ïɸ½àÆþ½ÐÎÏ´ØÏ¢¤Î´Ø¿ô¤Ï¥í¥Ã¥¯½èÍý¤ò¹Ô¤ï¤Ê¤¤¡£
167 .TP
168 .B FSETLOCKING_QUERY
169 .\"O Don't change the type of locking.
170 .\"O (Only return it.)
171 ¥í¥Ã¥¯·Á¼°¤ÎÊѹ¹¤ò¹Ô¤ï¤Ê¤¤¡£(¸½ºß¤Î·Á¼°¤òÊÖ¤¹¤À¤±¤Ç¤¢¤ë)
172 .LP
173 .\"O The
174 .\"O .BR _flushlbf ()
175 .\"O function flushes all line-buffered streams.
176 .\"O (Presumably so that
177 .\"O output to a terminal is forced out, say before reading keyboard input.)
178 .BR _flushlbf ()
179 ´Ø¿ô¤Ï¡¢¤¹¤Ù¤Æ¤Î¥é¥¤¥ó¥Ð¥Ã¥Õ¥¡ (line-buffered) ¥¿¥¤¥×¤Î¥¹¥È¥ê¡¼¥à¤Î
180 ÆâÍƤò½ÐÎÏ(¥Õ¥é¥Ã¥·¥å)¤¹¤ë¡£
181 (ÅöÁ³¤Ê¤¬¤é¡¢Ã¼Ëö¤Ø¤Î½ÐÎϤ¬¶¯À©Åª¤Ë¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢
182 ¥­¡¼¥Ü¡¼¥É¤«¤é¤ÎÆþÎϤòÆɤߤ³¤àÁ°¤Ë¤³¤Î´Ø¿ô¤ò¸Æ¤ó¤ÀÊý¤¬¤¤¤¤¤À¤í¤¦)
183 .LP
184 .\"O The
185 .\"O .BR __fpurge ()
186 .\"O function discards the contents of the stream's buffer.
187 .BR __fpurge ()
188 ´Ø¿ô¤Ï¡¢¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍƤòÇÑ´þ¤¹¤ë¡£
189 .\"O .SH "SEE ALSO"
190 .SH ´ØÏ¢¹àÌÜ
191 .BR flockfile (3),
192 .BR fpurge (3)