OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / stdio_ext.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH STDIO_EXT 3 2013\-06\-21 "" "Linux Programmer's Manual"
31 .SH 名前
32 __fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading,
33 __fsetlocking, __fwritable, __fwriting, _flushlbf \- 標準入出力ファイル構造体へのインタフェース
34 .SH 書式
35 \fB#include <stdio.h>\fP
36 .br
37 \fB#include <stdio_ext.h>\fP
38 .sp
39 \fBsize_t __fbufsize(FILE *\fP\fIstream\fP\fB);\fP
40 .br
41 \fBsize_t __fpending(FILE *\fP\fIstream\fP\fB);\fP
42 .br
43 \fBint __flbf(FILE *\fP\fIstream\fP\fB);\fP
44 .br
45 \fBint __freadable(FILE *\fP\fIstream\fP\fB);\fP
46 .br
47 \fBint __fwritable(FILE *\fP\fIstream\fP\fB);\fP
48 .br
49 \fBint __freading(FILE *\fP\fIstream\fP\fB);\fP
50 .br
51 \fBint __fwriting(FILE *\fP\fIstream\fP\fB);\fP
52 .br
53 \fBint __fsetlocking(FILE *\fP\fIstream\fP\fB, int \fP\fItype\fP\fB);\fP
54 .br
55 \fBvoid _flushlbf(void);\fP
56 .br
57 \fBvoid __fpurge(FILE *\fP\fIstream\fP\fB);\fP
58 .SH 説明
59 Solaris では、 \fIFILE\fP 構造体の内部へポータブルなかたちで アクセスできる手段が導入されており、これらは glibc
60 でも実装されている。
61 .LP
62 \fB__fbufsize\fP()  関数は、指定されたストリームが使用しているバッファサイズを返す。
63 .LP
64 \fB__fpending\fP()  関数は、出力バッファに入っているデータのバイト数を返す。
65 ワイドキャラクタを扱うストリームの場合、ワイドキャラクタ単位で計算される。 バッファが読み出しモードの場合や読み出し専用で開かれている場合の
66 この関数の振舞いは未定義である。
67 .LP
68 \fB__flbf\fP()  関数は、ストリームがラインバッファの場合は 0 以外を、 それ以外の場合は 0 を返す。
69 .LP
70 \fB__freadable\fP()  関数は、ストリームが読み出し可能な場合は 0 以外を、 それ以外の場合は 0 を返す。
71 .LP
72 \fB__fwritable\fP()  関数は、ストリームが書き込み可能な場合は 0 以外を、 それ以外の場合は 0 を返す。
73 .LP
74 \fB__freading\fP()  関数は、ストリームが読み出し専用の場合、またはストリームに対する直前の操作が 読み出し操作であった場合は 0
75 以外を返し、それ以外の場合は 0 を返す。
76 .LP
77 \fB__fwriting\fP()  関数は、ストリームが書き込み専用(もしくは追加専用)の場合、
78 またはストリームに対する直前の操作が書き込み操作であった場合は 0 以外を返し、 それ以外の場合は 0 を返す。
79 .LP
80 \fB__fsetlocking\fP()  関数は、ストリームのロック形式を選択するために使用できる。 返り値は、現在のロック形式である。 \fItype\fP
81 引き数は以下の 3 種類の値をとることができる :
82 .TP 
83 \fBFSETLOCKING_INTERNAL\fP
84 指定されたストリームに対して操作が行われる度に、操作の前後で 明示的に指示しなくてもストリームのロック処理を行う (但し、*_unlocked
85 関数を使用した場合は例外である)。 これがデフォルトのロック形式である。
86 .TP 
87 \fBFSETLOCKING_BYCALLER\fP
88 関数の呼び出し元でロックの面倒をみる。 (おそらく、複数のスレッドが存在する状況では \fBflockfile\fP(3)  を使うことになるだろう)
89 ロック形式が \fBFSETLOCKING_INTERNAL\fP にリセットされるまでは標準入出力関連の関数はロック処理を行わない。
90 .TP 
91 \fBFSETLOCKING_QUERY\fP
92 ロック形式の変更を行わない。(現在の形式を返すだけである)
93 .LP
94 \fB_flushlbf\fP()  関数は、すべてのラインバッファ (line\-buffered) タイプのストリームの 内容を出力(フラッシュ)する。
95 (当然ながら、端末への出力が強制的に行われることになるので、 キーボードからの入力を読みこむ前にこの関数を呼んだ方がいいだろう)
96 .LP
97 \fB__fpurge\fP()  関数は、ストリームのバッファの内容を廃棄する。
98 .SH 属性
99 .SS "マルチスレッディング (pthreads(7) 参照)"
100 The \fB__fbufsize\fP(), \fB__fpending\fP(), \fB__fpurge\fP()  and \fB__fsetlocking\fP()
101 functions do not lock the stream, so they are not thread\-safe.
102 .LP
103 The \fB__flbf\fP(), \fB__freadable\fP(), \fB__freading\fP(), \fB__fwritable\fP(),
104 \fB__fwriting\fP()  and \fB_flushlbf\fP()  functions are thread\-safe.
105 .SH 関連項目
106 \fBflockfile\fP(3), \fBfpurge\fP(3)
107 .SH この文書について
108 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
109 である。プロジェクトの説明とバグ報告に関する情報は
110 http://www.kernel.org/doc/man\-pages/ に書かれている。