--- /dev/null
+.\" Copyright (C) 2007, 2010 Michael Kerrisk <mtk.manpages@gmail.com>
+.\" and Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
+.\"
+.\" %%%LICENSE_START(VERBATIM)
+.\" Permission is granted to make and distribute verbatim copies of this
+.\" manual provided the copyright notice and this permission notice are
+.\" preserved on all copies.
+.\"
+.\" Permission is granted to copy and distribute modified versions of this
+.\" manual under the conditions for verbatim copying, provided that the
+.\" entire resulting derived work is distributed under the terms of a
+.\" permission notice identical to this one.
+.\"
+.\" Since the Linux kernel and libraries are constantly changing, this
+.\" manual page may be incorrect or out-of-date. The author(s) assume no
+.\" responsibility for errors or omissions, or for damages resulting from
+.\" the use of the information contained herein. The author(s) may not
+.\" have taken the same level of care in the production of this manual,
+.\" which is licensed free of charge, as they might when working
+.\" professionally.
+.\"
+.\" Formatted or processed versions of this manual, if unaccompanied by
+.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
+.\"
+.\" Modified Sat Jul 24 18:34:44 1993 by Rik Faith (faith@cs.unc.edu)
+.\" Merged readv.[23], 2002-10-17, aeb
+.\" 2007-04-30 mtk, A fairly major rewrite to fix errors and
+.\" add more details.
+.\" 2010-11-16, mtk, Added documentation of preadv() and pwritev()
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH READV 2 2010\-11\-17 Linux "Linux Programmer's Manual"
+.SH 名前
+readv, writev, preadv, pwritev \- 複数のバッファへの読み書きを行なう
+.SH 書式
+.nf
+\fB#include <sys/uio.h>\fP
+.sp
+\fBssize_t readv(int \fP\fIfd\fP\fB, const struct iovec *\fP\fIiov\fP\fB, int \fP\fIiovcnt\fP\fB);\fP
+.sp
+\fBssize_t writev(int \fP\fIfd\fP\fB, const struct iovec *\fP\fIiov\fP\fB, int \fP\fIiovcnt\fP\fB);\fP
+.sp
+\fBssize_t preadv(int \fP\fIfd\fP\fB, const struct iovec *\fP\fIiov\fP\fB, int \fP\fIiovcnt\fP\fB,\fP
+\fB off_t \fP\fIoffset\fP\fB);\fP
+.sp
+\fBssize_t pwritev(int \fP\fIfd\fP\fB, const struct iovec *\fP\fIiov\fP\fB, int \fP\fIiovcnt\fP\fB,\fP
+\fB off_t \fP\fIoffset\fP\fB);\fP
+.fi
+.sp
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
+.in
+.sp
+\fBpreadv\fP(), \fBpwritev\fP(): _BSD_SOURCE
+.SH 説明
+\fBreadv\fP() システムコールは、ファイルディスクリプタ \fIfd\fP に関連付けられた
+ファイルから、 \fIiovcnt\fP 個のバッファ分のデータを読み込み、 \fIiov\fP で指定
+されたバッファに格納する ("scatter input";「ばらまき入力」)。
+.PP
+\fBwritev\fP() システムコールは、 \fIiov\fP で指定されたバッファから最大 \fIiovcnt\fP
+個のバッファ分のデータを取り出し、 ファイルディスクリプタ \fIfd\fP に関連付けら
+れたファイルに書き込む ("gather output";「かき集め出力」)。
+.PP
+ポインタ \fIiov\fP は \fIiovec\fP 構造体の配列へのポインタである。 \fIiovec\fP 構造体は \fI<sys/uio.h>\fP
+で以下のように定義されている:
+.PP
+.br
+.in +4n
+.nf
+struct iovec {
+ void *iov_base; /* Starting address */
+ size_t iov_len; /* Number of bytes to transfer */
+};
+.fi
+.in
+.PP
+\fBreadv\fP() システムコールは、複数のバッファにデータを読み込む点を除いて
+\fBread\fP(2) と全く同様の動作を行う。
+.PP
+\fBwritev\fP() システムコールは、複数のバッファのデータを書き出す点以外は
+\fBwrite\fP(2) と全く同様の動作を行う。
+.PP
+バッファは配列の順序で処理される。これは、 \fBreadv\fP() が \fIiov\fP[0] が完全に一杯になるまでデータを詰めてから、
+\fIiov\fP[1] などに進むことを意味する (データが十分ない場合は、 \fIiov\fP が指すバッファのいずれも一杯にならない)。 同様に、
+\fBwritev\fP() は \fIiov\fP[0] の内容を全部書き出してから \fIiov\fP[1] などに進む。
+.PP
+\fBreadv\fP() と \fBwritev\fP() によるデータ転送は atomic に行われる。つまり、 \fBwritev\fP()
+によるデータ書き込みは一つのブロックとして行われ、他のプロセスの write による書き込みと混ざり合うことはない (例外に関しては
+\fBpipe\fP(7) を参照のこと)。同様に、 \fBreadv\fP() はファイルから連続するデータブロックが読み出すことが保証され、
+同じファイル記述 (file description; \fBopen\fP(2) 参照) を参照するファイルディスクリプタを持つ他のスレッドやプロセスが
+実行した read 操作の影響を受けることはない。
+.SS "preadv() と pwritev()"
+\fBpreadv\fP() システムコールは \fBreadv\fP() と \fBpreadv\fP(2) の機能を
+組み合わせたものである。
+\fBreadv\fP() と同じ処理を実行するが、
+4 番目の引き数 \fIoffset\fP が追加されており、
+この引き数は入力操作を行うファイルオフセットを指定する。
+
+\fBpwritev\fP() システムコールは \fBwritev\fP() と \fBpwrite\fP(2) の機能を
+組み合わせたものである。
+\fBwritev\fP() と同じ処理を実行するが、
+4 番目の引き数 \fIoffset\fP が追加されており、
+この引き数は出力操作を行うファイルオフセットを指定する。
+
+これらのシステムコールで、ファイルオフセットは変更されない。
+\fIfd\fP が参照するファイルは seek 可能でなければならない。
+.SH 返り値
+成功した場合、 \fBreadv\fP() と \fBpreadv\fP は読み込んだバイト数を返し、
+\fBwritev\fP() と \fBpwritev\fP()は書き込んだバイト数を返す。
+エラーの場合 \-1 を返し、\fIerrno\fP を適切に設定する。
+.SH エラー
+\fBread\fP(2) や \fBwrite\fP(2) と同じエラーが定義されている。
+さらに、 \fBpreadv\fP() と \fBpwritev\fP() は \fBlseek\fP(2) と同じ理由でも失敗する。
+また、追加で以下のエラーが定義されている:
+.TP
+\fBEINVAL\fP
+\fIiov_len\fP の合計が \fIssize_t\fP の範囲をオーバーフローした。もしくは、 ベクタ数 \fIiovcnt\fP が 0
+より小さいか許可された最大値よりも大きかった。
+.SH バージョン
+\fBpreadv\fP() と \fBpwritev\fP() は Linux 2.6.30 で初めて登場した。
+ライブラリによるサポートは glibc 2.10 で追加された。
+.SH 準拠
+.\" The readv/writev system calls were buggy before Linux 1.3.40.
+.\" (Says release.libc.)
+\fBreadv\fP(), \fBwritev\fP():
+4.4BSD (これらのシステムコールは 4.2BSD で最初に現われた)、POSIX.1\-2001。
+Linux libc5 では、 \fIiovcnt\fP 引き数の型として \fIsize_t\fP を、
+返り値の型として \fIint\fP を使用していた。
+
+\fBpreadv\fP(), \fBpwritev\fP(): 非標準だが、最近の BSD にも存在する。
+.SH 注意
+.SS "Linux での注意"
+POSIX.1\-2001 では、 \fIiov\fP で渡すことができる要素数に上限を設ける実装が認められている。 実装は、
+\fI<limits.h>\fP の \fBIOV_MAX\fP を定義することや、実行時に \fIsysconf(_SC_IOV_MAX)\fP
+の返り値経由で、この上限を広告することができる。 Linux では、この仕組みにより広告される上限は 1024 であり、
+この値はカーネルでの上限そのものである。 一方で、glibc のラッパー関数は、その関数の内部で呼ばれるカーネル
+システムコールがこの上限を超過して失敗したことを検出すると、 追加の動作をする。 \fBreadv\fP() の場合、ラッパー関数は \fIiov\fP
+で指定された全ての要素を格納できる大きさの一時バッファを割り当て、 \fBread\fP(2) を呼び出す際にそのバッファを渡し、 そのバッファのデータを
+\fIiov\fP の各要素の \fIiov_base\fP フィールドが指定する場所にコピーしてから、 そのバッファを解放する。 \fBwritev\fP()
+のラッパー関数も、同じように一時バッファを使って \fBwrite\fP(2) を呼び出す。
+.SH バグ
+ファイルディスクリプタに対する操作を行う \fBreadv\fP() や \fBwritev\fP() と、
+標準入出力ライブラリの関数をごちゃまぜにして呼ぶのはお薦めしない。
+どんな結果になるかは定義されておらず、おそらく期待する結果は
+得られないだろう。
+.SH 例
+以下のサンプルコードは \fBwritev\fP() の使用方法を示すものである。
+
+.in +4n
+.nf
+char *str0 = "hello ";
+char *str1 = "world\en";
+struct iovec iov[2];
+ssize_t nwritten;
+
+iov[0].iov_base = str0;
+iov[0].iov_len = strlen(str0);
+iov[1].iov_base = str1;
+iov[1].iov_len = strlen(str1);
+
+nwritten = writev(STDOUT_FILENO, iov, 2);
+.fi
+.in
+.SH 関連項目
+\fBpread\fP(2), \fBread\fP(2), \fBwrite\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)fclose.3 6.7 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu
+.\"
+.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH FCLOSE 3 2009\-02\-23 GNU "Linux Programmer's Manual"
+.SH 名前
+fclose \- ストリームを閉じる
+.SH 書式
+\fB#include <stdio.h>\fP
+.sp
+\fBint fclose(FILE *\fP\fIfp\fP\fB);\fP
+.SH 説明
+\fBfclose\fP() 関数は、 \fIfp\fP が指すストリームを (バッファリングされて
+いた全ての出力データを \fBfflush\fP(3) を用いて書き込んで) フラッシュし、
+対応するファイルディスクリプタをクローズする。
+.SH 返り値
+関数が正常に終了すると 0 が返される。 正常に終了しなかった場合には \fBEOF\fP が返され、 \fIerrno\fP がエラーを示すために設定される。
+どちらの場合も、そのストリームに対する (\fBfclose\fP() へのさらなる呼び出しを含む) それ以上のアクセスは 未定義の動作を生じさせる。
+.SH エラー
+.TP
+\fBEBADF\fP
+.\" This error cannot occur unless you are mixing ANSI C stdio operations and
+.\" low-level file operations on the same stream. If you do get this error,
+.\" you must have closed the stream's low-level file descriptor using
+.\" something like close(fileno(fp)).
+\fIfp\fP の基となるファイルディスクリプタが不正である。
+.PP
+\fBfclose\fP() 関数はこれ以外にも \fBclose\fP(2), \fBwrite\fP(2), \fBfflush\fP(3)
+のルーチンで失敗することがある。その場合は \fIerrno\fP が、失敗したルーチンで設定された値に設定される。
+.SH 準拠
+C89, C99.
+.SH 注意
+\fBfclose\fP() は C ライブラリで提供されたユーザー空間バッファをフラッシュするだけで ある点に注意すること。
+データを確実に物理的にディスクに記録するためには カーネルバッファも (\fBsync\fP(2) や \fBfsync\fP(2) を用いて)
+フラッシュしなければならない。
+.SH 関連項目
+\fBclose\fP(2), \fBfcloseall\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBsetbuf\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)fflush.3 5.4 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\"
+.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
+.\" Modified 2001-10-16 by John Levon <moz@compsoc.man.ac.uk>
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH FFLUSH 3 2009\-09\-06 GNU "Linux Programmer's Manual"
+.SH 名前
+fflush \- ストリームの内容を強制的に出力(フラッシュ)する
+.SH 書式
+\fB#include <stdio.h>\fP
+.sp
+\fBint fflush(FILE *\fP\fIstream\fP\fB);\fP
+.SH 説明
+出力ストリームに関しては、 \fBfflush\fP() は、ユーザー空間でバッファリングされているすべてのデータを 指定された出力に書き出す
+(フラッシュする)、 もしくはストリーム \fIstream\fP の下位にある書き込み関数を用いてこのストリームを更新する。 入力ストリームに関しては、
+\fBfflush\fP() は、対応するファイルから取得されたが、アプリケーションからは 読み出されていないバッファデータを全て破棄する。
+ストリームは開いた状態のままであり、 この関数によって何の影響も受けない。
+.PP
+\fIstream\fP 引数が .BR NULL ならば、 \fBfflush\fP() は開いている\fIすべての\fP出力ストリームをフラッシュする。
+.PP
+これらの処理をロックせずに行いたいときは、 \fBunlocked_stdio\fP(3) を参照のこと。
+.SH 返り値
+成功すると 0 が返される。 その他の場合には \fBEOF\fP が返され、 \fIerrno\fP が、エラーに対応した値に設定される。
+.SH エラー
+.TP
+\fBEBADF\fP
+\fIStream\fP は開いているストリームではない。 あるいはストリームは書き込み用ではない。
+.PP
+\fBfflush\fP() 関数は \fBwrite\fP(2) に関して規定されているエラーで失敗することもある。 この場合 \fIerrno\fP
+もその値に設定される。
+.SH 準拠
+C89, C99, POSIX.1\-2001, POSIX.1\-2008.
+
+.\" Verified on: Solaris 8.
+標準では、入力ストリームに対する動作は規定されていない。 他のほとんどの実装は Linux と同じ動作をする。
+.SH 注意
+\fBfflush\fP() は、 C ライブラリが与えているユーザー空間のバッファしかフラッシュしない。
+データが物理的にディスクに保存されることを保証したければ、 カーネルバッファもフラッシュしなければならない。 これには例えば \fBsync\fP(2) や
+\fBfsync\fP(2) を用いる。
+.SH 関連項目
+\fBfsync\fP(2), \fBsync\fP(2), \fBwrite\fP(2), \fBfclose\fP(3), \fBfopen\fP(3),
+\fBsetbuf\fP(3), \fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)fopen.3 6.8 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\" Modified, aeb, 960421, 970806
+.\" Modified, joey, aeb, 2002-01-03
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH FOPEN 3 2012\-04\-22 GNU "Linux Programmer's Manual"
+.SH 名前
+fopen, fdopen, freopen \- ストリームを開く関数
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+.sp
+\fBFILE *fopen(const char *\fP\fIpath\fP\fB, const char *\fP\fImode\fP\fB);\fP
+
+\fBFILE *fdopen(int \fP\fIfd\fP\fB, const char *\fP\fImode\fP\fB);\fP
+
+\fBFILE *freopen(const char *\fP\fIpath\fP\fB, const char *\fP\fImode\fP\fB, FILE *\fP\fIstream\fP\fB);\fP
+.fi
+.sp
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
+.in
+.sp
+\fBfdopen\fP(): _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
+.SH 説明
+\fBfopen\fP() 関数は、 \fIpath\fP で指定された名前のファイルを開き、ストリームと結びつける。
+.PP
+引数 \fImode\fP は、以下に続く文字のひとつから始まる文字列へのポインタであ
+る (以下の述べる、追加の文字が後に続くこともある):
+.TP
+\fBr\fP
+テキストファイルを読み出すために開く。 ストリームはファイルの先頭に位置される。
+.TP
+\fBr+\fP
+読み出しおよび書き込みするために開く。 ストリームはファイルの先頭に位置される。
+.TP
+\fBw\fP
+ファイルを書き込みのために開く。 ファイルが既に存在する場合には長さゼロに切り詰める。 ファイルがなかった場合には新たに作成する。
+ストリームはファイルの先頭に位置される。
+.TP
+\fBw+\fP
+読み出しおよび書き込みのために開く。 ファイルが存在していない場合には新たに作成する。 存在している場合には長さゼロに切り詰められる。
+ストリームはファイルの先頭に位置される。
+.TP
+\fBa\fP
+追加 (ファイルの最後に書き込む) のために開く。 ファイルが存在していない場合には新たに作成する。 ストリームはファイルの最後に位置される。
+.TP
+\fBa+\fP
+読み出しおよび追加 (ファイルの最後に書き込む) のために開く。 ファイルが存在していない場合には新たに作成する。
+読み出しの初期ファイル位置はファイルの先頭であるが、 書き込みは常にファイルの最後に追加される。
+.PP
+\fImode\fP 文字列には文字 \(aqb\(aq を追加指定することができ、 \fImode\fP 文字列の最後の文字として指定する。 上記のうち 2
+文字のモードの場合には 2 つの文字の間に指定することもできる。 これは C89 との互換性のためだけに用意された
+ものであり、関数の実行に対してはいかなる影響も持たない。 すなわち、Linux を含む全ての POSIX 準拠システムでは、 この \(aqb\(aq
+は無視される。 (その他のシステムではテキストファイルとバイナリファイルを別々に扱うものもあるので、 もしバイナリファイルの入出力を行い、
+そのプログラムが非 UNIX 環境へ移植されると予測するなら、 \(aqb\(aqを付けておくのは良い考えである)
+.PP
+\fImode\fP の glibc による拡張の詳細については下記の「注意」を参照。
+.PP
+すべての生成されたファイルは、 \fBS_IRUSR\fP | \fBS_IWUSR\fP | \fBS_IRGRP\fP | \fBS_IWGRP\fP |
+\fBS_IROTH\fP | \fBS_IWOTH\fP (0666) のモードを そのプロセスの umask 値によって修正したモードを持つ
+(\fBumask\fP(2) を見よ)。
+.PP
+読み出し/書き込みストリームに対しては任意の順序で読み書きを行うことができる。 ただし ANSI C では、
+(入力操作がファイルの末尾に到達した場合を除いて) 出力と入力の間にはファイルの位置決め関数を 挟まなければならないことになっていることに注意されたい
+(この条件を満足しない場合には、読み込み操作は、 最後に書き込まれたものでなく、以前に書き込まれた 値を返すことを許されている)。
+したがって、このようなストリームでの読み書き操作の間には \fBfseek\fP(3) または \fBfgetpos\fP(3) 操作を挟んでおくと良いだろう
+(Linux では本当に必要となることもときどきある)。 この操作は見かけ上何もしない操作 (no\-op) でも良い (例えば \fIfseek(...,
+0L, SEEK_CUR)\fP を その副次的効果である同期のためだけに呼べば良い)。
+.PP
+ファイルを追加モード (\fImode\fP の最初の文字を \fBa\fP にする) で開くと、
+このストリームに対する書き込み操作は全て (先に以下の呼び出しを行った
+かのように) ファイルの末尾で行われる。
+.nf
+
+ fseek(stream, 0, SEEK_END);
+.fi
+.PP
+\fBfdopen\fP() 関数は、既存のファイル記述子 \fIfd\fP にストリームを結びつける。 ストリームの \fImode\fP ("r", "r+",
+"w", "w+", "a", "a+" のいずれか) は ファイル記述子のモードと互換のものでなければならない。
+新しいストリームのファイル位置指示子は \fIfd\fP に属している値に設定される。 error と end\-of\-file の各指示子はクリアされる。
+"w" および "w+" モードでのファイルの切り詰めは行われない。 ファイル記述子の複製は行なわれない。 \fBfdopen\fP()
+で作成されたストリームが閉じられたときにファイル記述子も 閉じられる。 共有メモリのオブジェクトへ \fBfdopen\fP()
+を行ったときの結果は定義されていない。
+.PP
+\fBfreopen\fP() 関数は \fIpath\fP で名前が指定されたファイルを開き、 \fIstream\fP
+で指定されたストリームに、そのファイルを結びつける。 もとのストリームは (もし存在する場合には) 閉じられる。 \fImode\fP 引数は
+\fBfopen\fP() 関数と同じ形で使われる。 \fBfreopen\fP() 関数の主な用途は、標準テキストストリーム (\fIstderr\fP,
+\fIstdin\fP, \fIstdout\fP) と対応付けられているファイルを変更することである。
+.SH 返り値
+\fBfopen\fP(), \fBfdopen\fP(), \fBfreopen\fP() は成功すると \fIFILE\fP 型のポインタを返す。 失敗すると NULL
+が返され、 \fIerrno\fP がエラーを示す値にセットされる。
+.SH エラー
+.TP
+\fBEINVAL\fP
+\fBfopen\fP(), \fBfdopen\fP(), \fBfreopen\fP() で与えられた \fImode\fP が不適切である。
+.PP
+\fBfopen\fP(), \fBfdopen\fP(), \fBfreopen\fP() 関数は \fBmalloc\fP(3)
+ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に \fIerrno\fP をセットする。
+.PP
+\fBfopen\fP() 関数は \fBopen\fP(2) ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に \fIerrno\fP
+をセットする。
+.PP
+\fBfdopen\fP() 関数は \fBfcntl\fP(2) ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に
+\fIerrno\fP をセットする。
+.PP
+\fBfreopen\fP() 関数は \fBopen\fP(2), \fBfclose\fP(3), \fBfflush\fP(3)
+各ルーチンで規定されているエラーでも失敗することがあり、 その時は対応する値に \fIerrno\fP をセットする。
+.SH 準拠
+\fBfopen\fP() 関数と \fBfreopen\fP() 関数は C89に準拠している。 \fBfdopen\fP() 関数は POSIX.1\-1990
+に準拠している。
+.SH 注意
+.SS "glibc での注意"
+GNU C ライブラリでは、 \fImode\fP に指定できる文字列として、以下の拡張が行われている:
+.TP
+\fBc\fP (glibc 2.3.3 以降)
+open 操作、それに続く read/write 操作の、 スレッドの取り消しポイント
+(cancellation points) を作成しない。
+このフラグは \fBfdopen\fP() では無視される。
+.TP
+\fBe\fP (glibc 2.7 以降)
+\fBO_CLOEXEC\fP フラグを有効にしてファイルをオープンする。詳細は
+\fBopen\fP(2) を参照。このフラグは \fBfdopen\fP() では無視される。
+.TP
+\fBm\fP (glibc 2.3 以降)
+.\" As at glibc 2.4:
+I/O システムコール (\fBread\fP(2), \fBwrite\fP(2)) ではなく、 \fBmmap\fP(2)
+を使ってファイルにアクセスしようとする。 \fBmmap\fP(2) を使おうとするのは、読み出し用にオープンするファイルについてだけである。
+.TP
+\fBx\fP
+.\" Since glibc 2.0?
+.\" FIXME C11 specifies this flag
+ファイルを排他的にオープンする (\fBopen\fP(2) の \fBO_EXCL\fP フラグと同様)。 ファイルがすでに存在する場合、 \fBfopen\fP()
+は失敗し、 \fIerrno\fP に \fBEEXIST\fP がセットされる。 このフラグは \fBfdopen\fP() では無視される。
+.PP
+上記の文字に加えて、
+\fBfopen\fP() と \fBfreopen\fP() では \fImode\fP に
+以下の書式を 指定することができる。
+
+\fB ,ccs=\fP\fIstring\fP
+
+指定された \fIstring\fP は、符号化文字集合の名前と解釈され、
+ストリームではワイド文字のストリームとして扱われる。
+内部変換関数で入出力時に文字集合 \fIstring\fP との変換が行われる。
+書式 \fB,ccs=\fP\fIstring\fP が指定されない場合は、
+ストリームをワイド文字のストリームとして扱うかは
+最初のファイル操作時に決定される。
+最初のファイル操作がワイド文字操作であった場合は、
+そのストリームはワイド文字のストリームとして扱われ、
+符号化文字集合との変換を行う関数が読み込まれる。
+.SH バグ
+.\" FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12685
+\fImode\fP の個々のフラグ文字 ("ccs" 指定の前の文字) を解釈する際に、
+glibc の \fBfopen\fP() と \fBfreopen\fP() の実装では、
+\fImode\fP の確認を最大 7 文字しか行わないという制限がある
+(バージョン 2.14 より前の glibc では最大 6 文字だが、
+6 文字では "rb+cmxe" などの指定を行うには不十分であった)。
+\fBfdopen\fP() の現在の実装では最大 5 文字の \fImode\fP しか解釈されない。
+.SH 関連項目
+\fBopen\fP(2), \fBfclose\fP(3), \fBfileno\fP(3), \fBfmemopen\fP(3), \fBfopencookie\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Chris Torek and the American National Standards Committee X3,
+.\" on Information Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)fseek.3 6.11 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH FSEEK 3 1993\-11\-29 GNU "Linux Programmer's Manual"
+.SH 名前
+fgetpos, fseek, fsetpos, ftell, rewind \- ストリームの位置を変更する
+.SH 書式
+\fB#include <stdio.h>\fP
+.sp
+\fBint fseek(FILE *\fP\fIstream\fP\fB, long \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
+
+\fBlong ftell(FILE *\fP\fIstream\fP\fB);\fP
+
+\fBvoid rewind(FILE *\fP\fIstream\fP\fB);\fP
+
+\fBint fgetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP
+.br
+\fBint fsetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP
+.SH 説明
+\fBfseek\fP() 関数は \fIstream\fP によって指定されたストリームにおいて、ファイル位置表示子 (file position
+indicator) をセットする。新たな位置 (バイト単位) は \fIwhence\fP で指定された位置に \fIoffset\fP
+バイトを加えることによって与えられる。 \fIwhence\fP が \fBSEEK_SET\fP, \fBSEEK_CUR\fP, \fBSEEK_END\fP
+のどれかになっている場合は、それぞれファイルの先頭、現在の位置表示子、 ファイルの末尾からのオフセットが取られる。 \fBfseek\fP()
+関数の呼び出しが成功すると、ストリームの end\-of\-file 表示子は クリアされ、それまでに \fBungetc\fP(3)
+関数で戻したデータはなかったことになる。
+.PP
+\fBftell\fP() 関数は \fIstream\fP によって指定されたストリームにおける、ファイル位置表示子 の現時点での値を与える。
+.PP
+\fBrewind\fP() 関数は \fIstream\fP によって指定されたストリームにおいて、ファイル位置表示子
+をファイルの先頭にセットする。この関数は以下と等価である。
+.PP
+.RS
+(void) fseek(stream, 0L, SEEK_SET)
+.RE
+.PP
+ただし \fBrewind\fP() ではストリームに対するエラー表示子 (error indicator) も同時に クリアされる (
+\fBclearerr\fP(3) を見よ)。
+.PP
+\fBfgetpos\fP() 関数と \fBfsetpos\fP() 関数は、それぞれ \fBftell\fP() と \fBfseek\fP() で
+\fIwhence\fP に \fBSEEK_SET\fP を指定した場合と同様の機能を、異なるインターフェースで提供する。 \fBfgetpos\fP()
+はファイルオフセットの現在の値を \fIpos\fP が参照するオブジェクトに保存し、 \fBfsetpos\fP() はファイルオフセットを \fIpos\fP
+に設定する。 UNIX 以外のシステムにおいては、 \fIfpos_t\fP が構造体などの複雑なオブジェクトになっていて、これらのルーチンがテキス
+トストリームでファイル位置を変更する方法のうち、移植性のある唯一のもの になっている場合もある。
+.SH 返り値
+\fBrewind\fP() は返り値を持たない。 \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() は成功すると 0
+を返す。 \fBftell\fP() は現在のオフセットを返す。失敗した場合は返り値は \-1 となり、 \fIerrno\fP にエラーを示す値がセットされる。
+.SH エラー
+.TP
+\fBEBADF\fP
+指定した \fIstream\fP がシークできない。
+.TP
+\fBEINVAL\fP
+\fBfseek\fP() 関数に対して与えた \fIwhence\fP 引数が \fBSEEK_SET\fP, \fBSEEK_END\fP, \fBSEEK_CUR\fP
+以外の値であった。
+.PP
+\fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP(), \fBftell\fP() は、それぞれ \fBfflush\fP(3),
+\fBfstat\fP(2), \fBlseek\fP(2), \fBmalloc\fP(3) などのルーチンを呼び出す際に失敗する可能性がある。この場合は
+それぞれ対応した \fIerrno\fP が設定される。
+.SH 準拠
+C89, C99.
+.SH 関連項目
+\fBlseek\fP(2), \fBfseeko\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the American National Standards Committee X3, on Information
+.\" Processing Systems.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)setbuf.3 6.10 (Berkeley) 6/29/91
+.\"
+.\" Converted for Linux, Mon Nov 29 14:55:24 1993, faith@cs.unc.edu
+.\" Added section to BUGS, Sun Mar 12 22:28:33 MET 1995,
+.\" Thomas.Koenig@ciw.uni-karlsruhe.de
+.\" Correction, Sun, 11 Apr 1999 15:55:18,
+.\" Martin Vicente <martin@netadmin.dgac.fr>
+.\" Correction, 2000-03-03, Andreas Jaeger <aj@suse.de>
+.\" Added return value for setvbuf, aeb,
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH SETBUF 3 2012\-08\-03 Linux "Linux Programmer's Manual"
+.SH 名前
+setbuf, setbuffer, setlinebuf, setvbuf \- ストリームのバッファリングの操作
+.SH 書式
+.nf
+\fB#include <stdio.h>\fP
+
+\fBvoid setbuf(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB);\fP
+
+\fBvoid setbuffer(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIsize\fP\fB);\fP
+
+\fBvoid setlinebuf(FILE *\fP\fIstream\fP\fB);\fP
+
+\fBint setvbuf(FILE *\fP\fIstream\fP\fB, char *\fP\fIbuf\fP\fB, int \fP\fImode\fP\fB, size_t \fP\fIsize\fP\fB);\fP
+.fi
+.sp
+.in -4n
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
+.in
+.sp
+\fBsetbuffer\fP(), \fBsetlinebuf\fP(): _BSD_SOURCE
+.SH 説明
+バッファリングには unbuffered, block buffered, line buffered の3つのタイプが ある。出力ストリームのタイプが
+unbuffered の場合、データを書き込むとすぐに出 力先ファイルに書き込まれるかターミナルに表示される。block buffered の場合、文
+字の読み書きはブロック単位でいっぺんに行われる。line buffered の場合、 新しい行が出力されるか、ターミナルデバイスに接続しているストリーム
+(通常、\fIstdin\fP) から新しい行が入力されるまで文字がたくわえられる。 ブロックを強制的に出力するには \fBfflush\fP(3) 関数を使う。
+(\fBfclose\fP(3) を参照のこと) 通常、ファイルはすべて block buffered である。ファイルに対して 初めて入出力処理を行うと
+\fBmalloc\fP(3) が呼び出されバッファが獲得される。もし ストリームが (通常、 \fIstdout\fP がそうであるように)
+ターミナルを参照する場合には、ファイルは line buffered と なる。標準エラー出力 \fIstderr\fP はデフォルトでは常に
+unbuffered である。
+.PP
+\fBsetvbuf\fP() 関数は、オープンしている任意のストリームに対してバッファを変更できる。 引き数 \fImode\fP は、次の 3
+つのマクロのうちいずれかである:
+.RS
+.TP
+\fB_IONBF\fP
+unbuffered
+.TP
+\fB_IOLBF\fP
+line buffered
+.TP
+\fB_IOFBF\fP
+fully buffered
+.RE
+.PP
+unbuffered のファイルを除き、 \fIbuf\fP 引数は \fIsize\fP
+バイト以上の大きさのバッファを指していなければならない。このバッファは現在の バッファの代わりに用いられる。もし、引数 \fIbuf\fP が NULL
+ならば、モードだけが変更される。 新しいバッファは次に読み書きした際に割り当てられる。 \fBsetvbuf\fP() 関数は、ストリームをオープンした後、
+そのストリームに対して何らかの操作をする前にのみ使用できる。
+.PP
+他の 3 つの関数は \fBsetvbuf\fP() の呼び出しに単純に置き換えることができる。 \fBsetbuf\fP() 関数は、
+.PP
+.in +4n
+setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
+.in
+.PP
+と全く同等だし、 \fBsetbuffer\fP() 関数は、バッファサイズがデフォルト値 \fBBUFSIZ\fP ではなく引数で与えられる点以外は同じである。
+\fBsetlinebuf\fP() 関数は以下と同じである。
+.PP
+.in +4n
+setvbuf(stream, NULL, _IOLBF, 0);
+.in
+.SH 返り値
+\fBsetvbuf\fP() 関数は、成功した場合 0 を返す。 失敗した場合、0 以外の値を返す (失敗とは、 \fImode\fP
+が不正な場合またはリクエストが条件を満たさない場合である)。 \fBsetvbuf\fP() 関数が失敗した場合は \fIerrno\fP を設定することもある。
+
+その他の関数は値を返さない。
+.SH 準拠
+\fBsetbuf\fP() 関数および \fBsetvbuf\fP() 関数は C89 と C99 に準拠している。
+.SH バグ
+\fBsetbuffer\fP() 関数および \fBsetlinebuf\fP() 関数は 4.2BSD より前の BSD とは互換性がない。また Linux
+でも(古いバージョン では)利用できないかもしれない。4.2BSD および 4.3BSD のシステムでは \fBsetbuf\fP()
+は必ず追加のバッファーのサイズを使用するので、これも使うべきでない。
+.P
+\fIstream\fP を閉じる時 (プログラムを終了する際にもこれは起きる) には、 \fIbuf\fP
+が指し示す空間とが存在していることを保証しなければならない。 例えば、次のような使い方は許されない:
+.nf
+.sp
+#include <stdio.h>
+
+int
+main(void)
+{
+ char buf[BUFSIZ];
+ setbuf(stdin, buf);
+ printf("Hello, world!\en");
+ return 0;
+}
+.fi
+.SH 関連項目
+\fBfclose\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBfread\fP(3), \fBmalloc\fP(3),
+\fBprintf\fP(3), \fBputs\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
--- /dev/null
+.\" Copyright (c) 1990, 1991 Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
+.\"
+.\" @(#)stdio.3 6.5 (Berkeley) 5/6/91
+.\"
+.\" Converted for Linux, Mon Nov 29 16:07:22 1993, faith@cs.unc.edu
+.\" Modified, 2001-12-26, aeb
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH STDIO 3 2001\-12\-26 "" "Linux Programmer's Manual"
+.SH 名前
+stdio \- 標準入出力ライブラリ関数
+.SH 書式
+\fB#include <stdio.h>\fP
+.sp
+\fBFILE *\fP\fIstdin\fP\fB;\fP
+.br
+\fBFILE *\fP\fIstdout\fP\fB;\fP
+.br
+\fBFILE *\fP\fIstderr\fP\fB;\fP
+.SH 説明
+標準入出力ライブラリは、簡単かつ効果のよい、 バッファリングされたストリーム入出力インターフェースを提供する。
+入力と出力は論理データストリームに割り付けられ、 入出力の物理的な特徴は隠蔽される。 このライブラリに属する関数とマクロを以下に挙げる。
+より詳しい情報は個々の man ページから得ることができる。
+.PP
+ファイルを \fIオープン (open) する\fP ことによって、 ストリームは外部ファイル (通常は物理デバイス) に連結される。
+この操作には新しくファイルを作成することも含まれる。 既存のファイルと同じ名前のファイルを新たに作ると、 もとのファイルの中身が捨てられてしまう。
+ファイルが位置指定リクエストをサポートしている (ディスクファイルなどが相当する。逆の例としては端末が挙げられる) 場合、 そのストリームに連結された
+\fIファイル位置指示子 (file position indicator)\fP は、追加モードで開かれない限りファイルの先頭 (0 バイト目)
+に位置する。 追加モードを使用した場合、 位置指示子をファイルの先頭に置かれるか末尾に置かれるかは規定されていない。 位置指示子は、
+以降の読み書きや位置指定リクエストによって変更される。 すべての入力は、 \fBfgetc\fP(3)
+関数を次々に呼び出して文字を読み込んだかのように行われる。 一方すべての出力は、 \fBfputc\fP(3)
+関数を次々に呼び出して文字を書き込んだかのように行われる。
+.PP
+ファイルを \fIクローズ (close) する\fP ことによって、そのファイルはストリームから切り離される。
+出力ストリームは、そのストリームがファイルから切り離される前にフラッシュされる (書き込まれていないすべてのバッファの内容がホスト環境に転送される)。
+\fIFILE\fP オブジェクトへのポインタの値は、 ファイルを閉じた後では不確定になる (ゴミになってしまう)。
+.PP
+ファイルはその後 (同じまたは別のプログラムによって) 再びオープンされることもあり、 その内容が修正されたり変更されたりする
+(そのファイルで先頭への位置移動が可能であれば)。 main 関数がもとの呼び出し側に返ったり、 \fBexit\fP(3) 関数が呼ばれた場合、
+プログラムの終了の前に 現在開いているすべてのファイルは閉じられる (その結果、すべての出力ストリームはフラッシュされる)。 プログラムの停止に
+\fBabort\fP(3) のような他の方法を用いた場合には、 ファイルが正しく閉じられる保証はない。
+.PP
+プログラムの起動時に 3 個のテキストストリームが予め定義されており、 それらは明示的に開く必要がない。 \fI標準入力 (standard
+input)\fP (通常の入力を読み取るのに使う)、 \fI標準出力 (standard output)\fP (通常の出力を書き込むのに使う)、
+\fI標準エラー出力 (standard error)\fP (診断出力を書き込むのに使う) である。 これらのストリームは \fIstdin\fP,
+\fIstdout\fP, \fIstderr\fP と短縮して表現される。 オープンされたときには、 標準エラーストリームは 完全にはバッファリングされていない。
+標準入力ストリームと標準出力ストリームは、 ストリームがインタラクティブなデバイスを参照していなければ、 完全にバッファリングされている。
+.PP
+端末デバイスを参照する出力ストリームは、 デフォルトでは常に行単位でバッファリングされている。 ただしそのようなストリームにおけるバッファ内の出力は、
+端末デバイスを参照している入力ストリームからの読み込みがあるたびに、 自動的に書き込まれる。 出力端末に行の一部を書き込んだ後で大量の計算を行う場合、
+出力が表示されるように、計算に取りかかる前に標準出力に対して \fBfflush\fP(3) を実行する必要がある。
+.PP
+\fIstdio\fP ライブラリは \fBlibc\fP ライブラリの一部であり、ルーチンは コンパイラー \fBcc\fP(1) と \fBpc\fP(1)
+によって必要な時に自動的に読み込まれる。 後述する man ページ中の「書式」の節には、 どのインクルードファイルを使用しなければならないか、
+その関数のコンパイラー宣言はどのようなものか、 どのような外部変数が関係するのかが示されている。
+.PP
+.\" Not on Linux: .BR fropen ,
+.\" Not on Linux: .BR fwopen ,
+\fBBUFSIZ\fP, \fBEOF\fP, \fBFILENAME_MAX\fP, \fBFOPEN_MAX\fP, \fBL_cuserid\fP,
+\fBL_ctermid\fP, \fBL_tmpnam\fP, \fBNULL\fP, \fBSEEK_END\fP, \fBSEEK_SET\fP, \fBSEEK_CUR\fP,
+\fBTMP_MAX\fP, \fBclearerr\fP, \fBfeof\fP, \fBferror\fP, \fBfileno\fP, \fBgetc\fP, \fBgetchar\fP,
+\fBputc\fP, \fBputchar\fP, \fBstderr\fP, \fBstdin\fP, \fBstdout\fP はマクロとして定義されている。
+これらの名前は、現在の定義を \fB#undef\fP で削除しない限り、再利用することはできない。 マクロ関数の関数版として、 \fBfeof\fP,
+\fBferror\fP, \fBclearerr\fP, \fBfileno\fP, \fBgetc\fP, \fBgetchar\fP, \fBputc\fP, \fBputchar\fP
+がある。 マクロの定義が明示的に消去されている場合には、 これらを使用することになるだろう。
+.SS 関数のリスト
+.TS
+;
+lb lb
+lb l.
+関数 説明
+_
+clearerr ストリームの状態の確認とリセット
+fclose ストリームをクローズする
+fdopen ストリームをオープンする
+feof ストリームの状態の確認とリセット
+ferror ストリームの状態の確認とリセット
+fflush ストリームをフラッシュする
+fgetc 次の文字または語を入力ストリームから獲得する
+fgetpos ストリームの位置を取得する
+fgets ストリームから行を取得する
+fileno 引き数であるストリームの整数値のディスクリプタを返す
+fopen ストリームをオープンする
+fprintf 書式付き出力変換
+fpurge ストリームをフラッシュする
+fputc 文字または語をストリームに出力する
+fputs 行をストリームに出力する
+fread バイナリーストリーム入出力
+freopen ストリームをオープンする
+fscanf 書式付き入力変換
+fseek ストリームの位置指示子を移動する
+fsetpos ストリームの位置指示子を移動する
+ftell ストリームの位置を取得する
+fwrite バイナリーストリーム入出力
+getc 次の文字または語を入力ストリームから取得する
+getchar 次の文字または語を入力ストリームから取得する
+gets 行を入力ストリームから取得する
+getw 次の文字または語を入力ストリームから取得する
+mktemp 他と重ならないテンポラリファイル名を作る
+perror システムエラーメッセージ
+printf 書式付き出力変換
+putc 文字または語をストリームに出力する
+putchar 文字または語をストリームに出力する
+puts 行をストリームに出力する
+putw 文字または語をストリームに出力する
+remove ディレクトリエントリを削除する
+rewind ストリームの位置指示子を移動する
+scanf 書式付き入力変換
+setbuf ストリームのバッファリングの操作
+setbuffer ストリームのバッファリングの操作
+setlinebuf ストリームのバッファリングの操作
+setvbuf ストリームのバッファリングの操作
+sprintf 書式付き出力変換
+sscanf 書式付き入力変換
+strerror システムエラーメッセージ
+sys_errlist システムエラーメッセージ
+sys_nerr システムエラーメッセージ
+tempnam テンポラリファイルの操作
+tmpfile テンポラリファイルの操作
+tmpnam テンポラリファイルの操作
+ungetc 入力ストリームへ 1 文字戻す。
+vfprintf 書式付き出力変換
+vfscanf 書式付き入力変換
+vprintf 書式付き出力変換
+vscanf 書式付き入力変換
+vsprintf 書式付き出力変換
+vsscanf 書式付き入力変換
+.TE
+.SH 準拠
+\fIstdio\fP ライブラリは C89 に準拠している。
+.SH 関連項目
+\fBclose\fP(2), \fBopen\fP(2), \fBread\fP(2), \fBwrite\fP(2), \fBstdout\fP(3),
+\fBunlocked_stdio\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-03-22 01:07+0900\n"
-"PO-Revision-Date: 2013-03-24 01:06+0900\n"
+"PO-Revision-Date: 2013-03-26 11:18+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
#. type: Plain text
#: build/C/man3/fclose.3:102
-#, fuzzy
-#| msgid ""
-#| "Note that B<fclose>() only flushes the user space buffers provided by "
-#| "the C library. To ensure that the data is physically stored on disk the "
-#| "kernel buffers must be flushed too, for example, with B<sync>(2) or "
-#| "B<fsync>(2)."
msgid ""
"Note that B<fclose>() only flushes the user-space buffers provided by the C "
"library. To ensure that the data is physically stored on disk the kernel "
#. type: Plain text
#: build/C/man3/fflush.3:108
-#, fuzzy
-#| msgid ""
-#| "Note that B<fflush>() only flushes the user space buffers provided by "
-#| "the C library. To ensure that the data is physically stored on disk the "
-#| "kernel buffers must be flushed too, for example, with B<sync>(2) or "
-#| "B<fsync>(2)."
msgid ""
"Note that B<fflush>() only flushes the user-space buffers provided by the C "
"library. To ensure that the data is physically stored on disk the kernel "
#. type: Plain text
#: build/C/man3/fopen.3:149
-#, fuzzy, no-wrap
-#| msgid " fseek(stream,0,SEEK_END);\n"
+#, no-wrap
msgid " fseek(stream, 0, SEEK_END);\n"
-msgstr " fseek(stream,0,SEEK_END);\n"
+msgstr " fseek(stream, 0, SEEK_END);\n"
#. type: Plain text
#: build/C/man3/fopen.3:171
#. type: SS
#: build/C/man3/fopen.3:256
-#, fuzzy, no-wrap
-#| msgid "Glibc Notes"
+#, no-wrap
msgid "Glibc notes"
msgstr "glibc での注意"
#. type: Plain text
#: build/C/man3/fseek.3:121
-#, fuzzy
-#| msgid ""
-#| "The B<fgetpos>() and B<fsetpos>() functions are alternate interfaces "
-#| "equivalent to B<ftell>() and B<fseek>() (with whence set to "
-#| "B<SEEK_SET>), setting and storing the current value of the file offset "
-#| "into or from the object referenced by I<pos>. On some non-UNIX systems "
-#| "an I<fpos_t> object may be a complex object and these routines may be the "
-#| "only way to portably reposition a text stream."
msgid ""
"The B<fgetpos>() and B<fsetpos>() functions are alternate interfaces "
"equivalent to B<ftell>() and B<fseek>() (with I<whence> set to "
#. type: TH
#: build/C/man2/link.2:31 build/C/man2/rename.2:32 build/C/man2/symlink.2:32
#: build/C/man2/write.2:39
-#, fuzzy, no-wrap
-#| msgid "2012-01-18"
+#, no-wrap
msgid "2013-01-27"
-msgstr "2012-01-18"
+msgstr "2013-01-27"
#. type: Plain text
#: build/C/man2/link.2:34
#. type: TP
#: build/C/man2/link.2:120
-#, fuzzy, no-wrap
-#| msgid "B<EPERM> (Linux only)"
+#, no-wrap
msgid "B<EPERM> (since Linux 3.6)"
-msgstr "B<EPERM> (Linux のみ)"
+msgstr "B<EPERM> (Linux 3.6 以降)"
#. type: Plain text
#: build/C/man2/link.2:127
#. type: TH
#: build/C/man2/llseek.2:28
-#, fuzzy, no-wrap
-#| msgid "2012-04-30"
+#, no-wrap
msgid "2012-07-13"
-msgstr "2012-04-30"
+msgstr "2012-07-13"
#. type: Plain text
#: build/C/man2/llseek.2:31
#. using SEEK_SET to set the counter. (Of written characters.)
#. type: Plain text
#: build/C/man2/lseek.2:212
-#, fuzzy
-#| msgid "On Linux, using B<lseek>() on a tty device returns B<ESPIPE>."
msgid "On Linux, using B<lseek>() on a terminal device returns B<ESPIPE>."
-msgstr ""
-"Linux では、 tty デバイスに B<lseek>() を使用すると B<ESPIPE> を返す。"
+msgstr "Linux では、端末 (terminal) デバイスに B<lseek>() を使用すると B<ESPIPE> が返る。"
#. type: Plain text
#: build/C/man2/lseek.2:215
#. type: TH
#: build/C/man2/open.2:52
-#, fuzzy, no-wrap
-#| msgid "2012-02-14"
+#, no-wrap
msgid "2013-02-18"
-msgstr "2012-02-14"
+msgstr "2013-02-18"
#. type: Plain text
#: build/C/man2/open.2:55
#. are also categorized" as file status flags.
#. type: Plain text
#: build/C/man2/open.2:153
-#, fuzzy
-#| msgid ""
-#| "In addition, zero or more file creation flags and file status flags can "
-#| "be bitwise-I<or>'d in I<flags>. The I<file creation flags> are "
-#| "B<O_CREAT>, B<O_EXCL>, B<O_NOCTTY>, and B<O_TRUNC>. The I<file status "
-#| "flags> are all of the remaining flags listed below. The distinction "
-#| "between these two groups of flags is that the file status flags can be "
-#| "retrieved and (in some cases) modified using B<fcntl>(2). The full list "
-#| "of file creation flags and file status flags is as follows:"
msgid ""
"In addition, zero or more file creation flags and file status flags can be "
"bitwise-I<or>'d in I<flags>. The I<file creation flags> are B<O_CLOEXEC>, "
"flags is that the file status flags can be retrieved and (in some cases) "
"modified using B<fcntl>(2). The full list of file creation flags and file "
"status flags is as follows:"
-msgstr ""
-"さらに、 I<flags> には、ファイル作成フラグ (file creation flag) とファイル状"
-"態フラグ (file status flag) を 0 個以上「ビット単位の OR (bitwise-or)」で 指"
-"定することができる。 I<ファイル作成フラグ> は B<O_CREAT>, B<O_EXCL>, "
-"B<O_NOCTTY>, B<O_TRUNC> である。 I<ファイル状態フラグ> は以下のリストのうち上"
-"記以外の残りのものである。 二種類のフラグの違いは、ファイル状態フラグの方は "
-"B<fcntl>(2) を使ってその内容を取得したり (場合によっては) 変更したりできる点"
-"にある。 ファイル作成フラグとファイル状態フラグの全リストを以下に示す:"
+msgstr "さらに、 I<flags> には、ファイル作成フラグ (file creation flag) とファイル状態フラグ (file status flag) を 0 個以上「ビット単位の OR (bitwise-or)」で 指定することができる。 I<ファイル作成フラグ> は B<O_CLOEXEC>, B<O_CREAT>, B<O_DIRECTORY>, B<O_EXCL>, B<O_NOCTTY>, B<O_NOFOLLOW>, B<O_TRUNC>, B<O_TTY_INIT> である。 I<ファイル状態フラグ> は以下のリストのうち上記以外の残りのものである。 二種類のフラグの違いは、ファイル状態フラグの方は B<fcntl>(2) を使ってその内容を取得したり (場合によっては) 変更したりできる点にある。 ファイル作成フラグとファイル状態フラグの全リストを以下に示す:"
#. type: TP
#: build/C/man2/open.2:153
#. type: Plain text
#: build/C/man2/open.2:304
-#, fuzzy
-#| msgid ""
-#| "Try to minimize cache effects of the I/O to and from this file. In "
-#| "general this will degrade performance, but it is useful in special "
-#| "situations, such as when applications do their own caching. File I/O is "
-#| "done directly to/from user space buffers. The B<O_DIRECT> flag on its "
-#| "own makes an effort to transfer data synchronously, but does not give the "
-#| "guarantees of the B<O_SYNC> flag that data and necessary metadata are "
-#| "transferred. To guarantee synchronous I/O, B<O_SYNC> must be used in "
-#| "addition to B<O_DIRECT>. See NOTES below for further discussion."
msgid ""
"Try to minimize cache effects of the I/O to and from this file. In general "
"this will degrade performance, but it is useful in special situations, such "
"B<O_SYNC> flag that data and necessary metadata are transferred. To "
"guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
"B<O_DIRECT>. See NOTES below for further discussion."
-msgstr ""
-"このファイルに対する I/O のキャッシュの効果を最小化しようとする。このフラグ"
-"を\n"
-"使うと、一般的に性能が低下する。 しかしアプリケーションが独自にキャッシング"
-"を\n"
-"行っているような 特別な場合には役に立つ。 ファイルの I/O はユーザー空間バッ"
-"ファ\n"
-"に対して直接行われる。 B<O_DIRECT> フラグ自身はデータを同期で転送しようとは"
-"す\n"
-"るが、 B<O_SYNC> フラグのようにデータと必要なメタデータの転送が保証されるわ"
-"け\n"
-"ではない。同期 I/O を保証するためには、 B<O_DIRECT> に加えて B<O_SYNC> を使"
-"用\n"
-"しなければならない。下記の「注意」の節の議論も参照。"
+msgstr "このファイルに対する I/O のキャッシュの効果を最小化しようとする。このフラグを使うと、一般的に性能が低下する。 しかしアプリケーションが独自にキャッシングを行っているような 特別な場合には役に立つ。 ファイルの I/O はユーザー空間バッファに対して直接行われる。 B<O_DIRECT> フラグ自身はデータを同期で転送しようとはするが、 B<O_SYNC> フラグのようにデータと必要なメタデータの転送が保証されるわけではない。同期 I/O を保証するためには、 B<O_DIRECT> に加えて B<O_SYNC> を使用しなければならない。下記の「注意」の節の議論も参照。"
#. type: Plain text
#: build/C/man2/open.2:308
#. by mmap() and readdir(2), MTK, Dec 04.
#. type: Plain text
#: build/C/man2/open.2:413
-#, fuzzy
-#| msgid ""
-#| "Do not update the file last access time (st_atime in the inode) when the "
-#| "file is B<read>(2). This flag is intended for use by indexing or backup "
-#| "programs, where its use can significantly reduce the amount of disk "
-#| "activity. This flag may not be effective on all file systems. One "
-#| "example is NFS, where the server maintains the access time."
msgid ""
"Do not update the file last access time (I<st_atime> in the inode) when the "
"file is B<read>(2). This flag is intended for use by indexing or backup "
"programs, where its use can significantly reduce the amount of disk "
"activity. This flag may not be effective on all file systems. One example "
"is NFS, where the server maintains the access time."
-msgstr ""
-"ファイルに対して B<read>(2) が実行されたときに、最終アクセス時刻 (inode の "
-"st_atime) を更新しない。 このフラグはインデックス作成やバックアッププログラム"
-"で使うことを意図している。 これを使うとディスクに対する操作を大幅に減らすこと"
-"ができる。 このフラグは全てのファイルシステムに対して有効であるわけではな"
-"い。 その一例が NFS であり、サーバがアクセス時刻を管理している。"
+msgstr "ファイルに対して B<read>(2) が実行されたときに、最終アクセス時刻 (inode の I<st_atime>) を更新しない。 このフラグはインデックス作成やバックアッププログラムで使うことを意図している。 これを使うとディスクに対する操作を大幅に減らすことができる。 このフラグは全てのファイルシステムに対して有効であるわけではない。 その一例が NFS であり、サーバがアクセス時刻を管理している。"
#. type: TP
#: build/C/man2/open.2:413
#. type: Plain text
#: build/C/man2/open.2:421
-#, fuzzy
-#| msgid ""
-#| "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(em it will "
-#| "not become the process's controlling terminal even if the process does "
-#| "not have one."
msgid ""
"If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(emit will not "
"become the process's controlling terminal even if the process does not have "
#. type: Plain text
#: build/C/man2/open.2:729
-#, fuzzy
-#| msgid ""
-#| "POSIX provides for three different variants of synchronized I/O, "
-#| "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>. "
-#| "Currently (2.6.31), Linux only implements B<O_SYNC>, but glibc maps "
-#| "B<O_DSYNC> and B<O_RSYNC> to the same numerical value as B<O_SYNC>. Most "
-#| "Linux file systems don't actually implement the POSIX B<O_SYNC> "
-#| "semantics, which require all metadata updates of a write to be on disk on "
-#| "returning to userspace, but only the B<O_DSYNC> semantics, which require "
-#| "only actual file data and metadata necessary to retrieve it to be on disk "
-#| "by the time the system call returns."
msgid ""
"POSIX provides for three different variants of synchronized I/O, "
"corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>. Currently "
#. type: Plain text
#: build/C/man2/open.2:786
-#, fuzzy
-#| msgid ""
-#| "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
-#| "address of userspace buffers and the file offset of I/Os. In Linux "
-#| "alignment restrictions vary by file system and kernel version and might "
-#| "be absent entirely. However there is currently no file system-"
-#| "independent interface for an application to discover these restrictions "
-#| "for a given file or file system. Some file systems provide their own "
-#| "interfaces for doing so, for example the B<XFS_IOC_DIOINFO> operation in "
-#| "B<xfsctl>(3)."
msgid ""
"The B<O_DIRECT> flag may impose alignment restrictions on the length and "
"address of user-space buffers and the file offset of I/Os. In Linux "
#. type: Plain text
#: build/C/man2/open.2:825
-#, fuzzy
-#| msgid ""
-#| "B<O_DIRECT> I/Os should never be run concurrently with the B<fork>(2) "
-#| "system call, if the memory buffer is a private mapping (i.e., any mapping "
-#| "created with the B<mmap(2)> B<MAP_PRIVATE> flag; this includes memory "
-#| "allocated on the heap and statically allocated buffers). Any such I/Os, "
-#| "whether submitted via an asynchronous I/O interface or from another "
-#| "thread in the process, should be completed before B<fork>(2) is called. "
-#| "Failure to do so can result in data corruption and undefined behavior in "
-#| "parent and child processes. This restriction does not apply when the "
-#| "memory buffer for the B<O_DIRECT> I/Os was created using B<shmat>(2) or "
-#| "B<mmap>(2) with the B<MAP_SHARED> flag. Nor does this restriction apply "
-#| "when the memory buffer has been advised as B<MADV_DONTFORK> with B<madvise"
-#| "(2),> ensuring that it will not be available to the child after B<fork>"
-#| "(2)."
msgid ""
"B<O_DIRECT> I/Os should never be run concurrently with the B<fork>(2) "
"system call, if the memory buffer is a private mapping (i.e., any mapping "
#. type: TH
#: build/C/man3/printf.3:34
-#, fuzzy, no-wrap
-#| msgid "2012-03-30"
+#, no-wrap
msgid "2013-03-05"
-msgstr "2012-03-30"
+msgstr "2013-03-05"
#. type: Plain text
#: build/C/man3/printf.3:38
#. type: Plain text
#: build/C/man3/printf.3:1044
-#, fuzzy, no-wrap
-#| msgid ""
-#| "char *\n"
-#| "make_message(const char *fmt, ...)\n"
-#| "{\n"
-#| " int n;\n"
-#| " int size = 100; /* Guess we need no more than 100 bytes. */\n"
-#| " char *p, *np;\n"
-#| " va_list ap;\n"
+#, no-wrap
msgid ""
"char *\n"
"make_message(const char *fmt, ...)\n"
"make_message(const char *fmt, ...)\n"
"{\n"
" int n;\n"
-" int size = 100; /* Guess we need no more than 100 bytes. */\n"
+" int size = 100; /* Guess we need no more than 100 bytes */\n"
" char *p, *np;\n"
" va_list ap;\n"
#. type: Plain text
#: build/C/man3/printf.3:1051
-#, fuzzy, no-wrap
-#| msgid " /* Try to print in the allocated space. */\n"
+#, no-wrap
msgid " /* Try to print in the allocated space */\n"
-msgstr " /* Try to print in the allocated space. */\n"
+msgstr " /* Try to print in the allocated space */\n"
#. type: Plain text
#: build/C/man3/printf.3:1055
#: build/C/man3/printf.3:1057
#, no-wrap
msgid " /* Check error code */\n"
-msgstr ""
+msgstr " /* Check error code */\n"
#. type: Plain text
#: build/C/man3/printf.3:1060
-#, fuzzy, no-wrap
-#| msgid ""
-#| " if (n E<gt> -1 && n E<lt> size)\n"
-#| " return p;\n"
+#, no-wrap
msgid ""
" if (n E<lt> 0)\n"
" return NULL;\n"
msgstr ""
-" if (n E<gt> -1 && n E<lt> size)\n"
-" return p;\n"
+" if (n E<lt> 0)\n"
+" return NULL;\n"
#. type: Plain text
#: build/C/man3/printf.3:1062
-#, fuzzy, no-wrap
-#| msgid " /* If that worked, return the string. */\n"
+#, no-wrap
msgid " /* If that worked, return the string */\n"
-msgstr " /* If that worked, return the string. */\n"
+msgstr " /* If that worked, return the string */\n"
#. type: Plain text
#: build/C/man3/printf.3:1065
-#, fuzzy, no-wrap
-#| msgid ""
-#| " if (n E<gt> -1 && n E<lt> size)\n"
-#| " return p;\n"
+#, no-wrap
msgid ""
" if (n E<lt> size)\n"
" return p;\n"
msgstr ""
-" if (n E<gt> -1 && n E<lt> size)\n"
+" if (n E<lt> size)\n"
" return p;\n"
#. type: Plain text
#: build/C/man3/printf.3:1067
-#, fuzzy, no-wrap
-#| msgid " /* Else try again with more space. */\n"
+#, no-wrap
msgid " /* Else try again with more space */\n"
-msgstr " /* Else try again with more space. */\n"
+msgstr " /* Else try again with more space */\n"
#. type: Plain text
#: build/C/man3/printf.3:1069
#, no-wrap
msgid " size = n + 1; /* Precisely what is needed */\n"
-msgstr ""
+msgstr " size = n + 1; /* Precisely what is needed */\n"
#. type: Plain text
#: build/C/man3/printf.3:1079
#. type: TH
#: build/C/man2/read.2:35
-#, fuzzy, no-wrap
-#| msgid "2012-02-14"
+#, no-wrap
msgid "2013-02-12"
-msgstr "2012-02-14"
+msgstr "2013-02-12"
#. type: Plain text
#: build/C/man2/read.2:38
#. type: Plain text
#: build/C/man2/read.2:81
-#, fuzzy
-#| msgid ""
-#| "If I<count> is zero, B<read>() returns zero and has no other results. "
-#| "If I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
msgid "If I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
-msgstr ""
-"I<count> が 0 ならば、 B<read>() は 0 を返し、他に何も起きない。 I<count> "
-"が B<SSIZE_MAX> より大きければ、結果は特定できない。"
+msgstr "I<count> が B<SSIZE_MAX> より大きければ、結果は規定できない。"
#. type: Plain text
#: build/C/man2/read.2:95
#. type: Plain text
#: build/C/man2/read.2:158
-#, fuzzy
-#| msgid ""
-#| "I/O error. This will happen for example when the process is in a "
-#| "background process group, tries to read from its controlling tty, and "
-#| "either it is ignoring or blocking B<SIGTTIN> or its process group is "
-#| "orphaned. It may also occur when there is a low-level I/O error while "
-#| "reading from a disk or tape."
msgid ""
"I/O error. This will happen for example when the process is in a background "
"process group, tries to read from its controlling terminal, and either it is "
"ignoring or blocking B<SIGTTIN> or its process group is orphaned. It may "
"also occur when there is a low-level I/O error while reading from a disk or "
"tape."
-msgstr ""
-"I/O エラー。これは例えばプロセスがバックグランド・プロセスグループで、 それを"
-"制御している tty から読み込もうとし、 B<SIGTTIN> が無視 (ignore) または禁止 "
-"(blocking) されている場合や、 そのプロセスグループが孤立 (orphan) している場"
-"合に起こる。 またディスクやテープを読んでいる時に低レベル I/O エラー が発生し"
-"た場合にも起こる。"
+msgstr "I/O エラー。これは例えばプロセスがバックグランド・プロセスグループで、それを制御している端末から読み込もうとし、 B<SIGTTIN> が無視 (ignore) または禁止 (blocking) されている場合や、 そのプロセスグループが孤立 (orphan) している場合に起こる。 またディスクやテープを読んでいる時に低レベル I/O エラー が発生した場合にも起こる。"
#. type: Plain text
#: build/C/man2/read.2:162
#. type: SS
#: build/C/man2/readv.2:227
-#, fuzzy, no-wrap
-#| msgid "Linux Notes"
+#, no-wrap
msgid "Linux notes"
msgstr "Linux での注意"
#. type: TH
#: build/C/man3/scanf.3:52
-#, fuzzy, no-wrap
-#| msgid "2012-01-18"
+#, no-wrap
msgid "2013-01-30"
-msgstr "2012-01-18"
+msgstr "2013-01-30"
#. type: Plain text
#: build/C/man3/scanf.3:55
#. type: Plain text
#: build/C/man3/scanf.3:625
-#, fuzzy
-#| msgid ""
-#| "The B<a> modifier is not available if the program is compiled with I<gcc -"
-#| "std=c99> or I<gcc -D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also "
-#| "specified), in which case the B<a> is interpreted as a specifier for "
-#| "floating-point numbers (see above)."
msgid ""
"It is not available if the program is compiled with I<gcc -std=c99> or I<gcc "
"-D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also specified), in which case "
"the B<a> is interpreted as a specifier for floating-point numbers (see "
"above)."
-msgstr ""
-"I<gcc -std=c99> や I<gcc -D_ISOC99_SOURCE> でコンパイルしたプログラムでは "
-"(B<_GNU_SOURCE> も同時に指定していない場合)、 B<a> 修飾子は利用できない。 上"
-"記の場合、 B<a> は (上述の通り) 浮動小数点数を示す変換指定子と解釈される。"
+msgstr "この修飾子は I<gcc -std=c99> や I<gcc -D_ISOC99_SOURCE> でコンパイルしたプログラムでは (B<_GNU_SOURCE> も同時に指定していない場合) 利用できない。この場合、 B<a> は (上述の通り) 浮動小数点数を示す変換指定子と解釈される。"
#. type: Plain text
#: build/C/man3/scanf.3:634
#. type: Plain text
#: build/C/man3/scanf.3:647
-#, fuzzy
-#| msgid "It is specified in the upcoming revision of the POSIX.1 standard."
msgid "It is specified in the POSIX.1-2008 standard."
-msgstr "POSIX.1 標準の次の改訂版で規定される。"
+msgstr "POSIX.1-2008 標準で規定されている。"
#. type: Plain text
#: build/C/man3/scanf.3:660
#. type: Plain text
#: build/C/man3/scanf.3:708
-#, fuzzy, no-wrap
-#| msgid ""
-#| "errno = 0;\n"
-#| "n = scanf(\"%a[a-z]\", &p);\n"
-#| "if (n == 1) {\n"
-#| " printf(\"read: %s\\en\", p);\n"
-#| " free(p);\n"
-#| "} else if (errno != 0) {\n"
-#| " perror(\"scanf\");\n"
-#| "} else {\n"
-#| " fprintf(stderr, \"No matching characters\\en\");\n"
-#| "}\n"
+#, no-wrap
msgid ""
"errno = 0;\n"
"n = scanf(\"%m[a-z]\", &p);\n"
"}\n"
msgstr ""
"errno = 0;\n"
-"n = scanf(\"%a[a-z]\", &p);\n"
+"n = scanf(\"%m[a-z]\", &p);\n"
"if (n == 1) {\n"
" printf(\"read: %s\\en\", p);\n"
" free(p);\n"
#. type: TH
#: build/C/man3/setbuf.3:48
-#, fuzzy, no-wrap
-#| msgid "2012-04-30"
+#, no-wrap
msgid "2012-08-03"
-msgstr "2012-04-30"
+msgstr "2012-08-03"
#. type: Plain text
#: build/C/man3/setbuf.3:51
#. type: Plain text
#: build/C/man3/setbuf.3:151
-#, fuzzy
-#| msgid "setvbuf(stream, (char *) NULL, _IOLBF, 0);"
msgid "setvbuf(stream, NULL, _IOLBF, 0);"
-msgstr "setvbuf(stream, (char *) NULL, _IOLBF, 0);"
+msgstr "setvbuf(stream, NULL, _IOLBF, 0);"
#. type: Plain text
#: build/C/man3/setbuf.3:162
#. type: Plain text
#: build/C/man3/stdio.3:119
-#, fuzzy
-#| msgid ""
-#| "At program startup, three text streams are predefined and need not be "
-#| "opened explicitly: I<standard input> (for reading conventional input), "
-#| "I<standard output> (for writing conventional input), and I<standard "
-#| "error> (for writing diagnostic output). These streams are abbreviated "
-#| "I<stdin>,I<stdout> and I<stderr>. When opened, the standard error stream "
-#| "is not fully buffered; the standard input and output streams are fully "
-#| "buffered if and only if the streams do not to refer to an interactive "
-#| "device."
msgid ""
"At program startup, three text streams are predefined and need not be opened "
"explicitly: I<standard input> (for reading conventional input), I<standard "
#. type: SS
#: build/C/man3/stdio.3:183
-#, fuzzy, no-wrap
-#| msgid "List of Functions"
+#, no-wrap
msgid "List of functions"
msgstr "関数のリスト"
\fBEPERM\fP
\fIoldpath\fP と \fInewpath\fP を含んでいるファイルシステムがハードリンクをサポートしていない。
.TP
-\fBEPERM\fP (since Linux 3.6)
+\fBEPERM\fP (Linux 3.6 以降)
The caller does not have permission to create a hard link to this file (see
the description of \fI/proc/sys/fs/protected_hardlink\fP in \fBproc\fP(5)).
.TP
.\" Other systems return the number of written characters,
.\" using SEEK_SET to set the counter. (Of written characters.)
-On Linux, using \fBlseek\fP() on a terminal device returns \fBESPIPE\fP.
+Linux では、端末 (terminal) デバイスに \fBlseek\fP() を使用すると \fBESPIPE\fP が返る。
古いコードを変換する時は \fIwhence\fP の値を以下のマクロに置き換えること:
.TS
.\" TC1 (balloted in 2013), resolved this, so that those three constants
.\" are also categorized" as file status flags.
.\"
-In addition, zero or more file creation flags and file status flags can be
-bitwise\-\fIor\fP'd in \fIflags\fP. The \fIfile creation flags\fP are \fBO_CLOEXEC\fP,
-\fBO_CREAT\fP, \fBO_DIRECTORY\fP, \fBO_EXCL\fP, \fBO_NOCTTY\fP, \fBO_NOFOLLOW\fP,
-\fBO_TRUNC\fP, and \fBO_TTY_INIT\fP. The \fIfile status flags\fP are all of the
-remaining flags listed below. The distinction between these two groups of
-flags is that the file status flags can be retrieved and (in some cases)
-modified using \fBfcntl\fP(2). The full list of file creation flags and file
-status flags is as follows:
+さらに、 \fIflags\fP には、ファイル作成フラグ (file creation flag) とファイル状態フラグ (file status
+flag) を 0 個以上「ビット単位の OR (bitwise\-or)」で 指定することができる。 \fIファイル作成フラグ\fP は
+\fBO_CLOEXEC\fP, \fBO_CREAT\fP, \fBO_DIRECTORY\fP, \fBO_EXCL\fP, \fBO_NOCTTY\fP,
+\fBO_NOFOLLOW\fP, \fBO_TRUNC\fP, \fBO_TTY_INIT\fP である。 \fIファイル状態フラグ\fP
+は以下のリストのうち上記以外の残りのものである。 二種類のフラグの違いは、ファイル状態フラグの方は \fBfcntl\fP(2)
+を使ってその内容を取得したり (場合によっては) 変更したりできる点にある。 ファイル作成フラグとファイル状態フラグの全リストを以下に示す:
.TP
\fBO_APPEND\fP
.\" For more background, see
.RE
.TP
\fBO_DIRECT\fP (Linux 2.4.10 以降)
-Try to minimize cache effects of the I/O to and from this file. In general
-this will degrade performance, but it is useful in special situations, such
-as when applications do their own caching. File I/O is done directly
-to/from user\-space buffers. The \fBO_DIRECT\fP flag on its own makes an effort
-to transfer data synchronously, but does not give the guarantees of the
-\fBO_SYNC\fP flag that data and necessary metadata are transferred. To
-guarantee synchronous I/O, \fBO_SYNC\fP must be used in addition to
-\fBO_DIRECT\fP. See NOTES below for further discussion.
+このファイルに対する I/O のキャッシュの効果を最小化しようとする。このフラグを使うと、一般的に性能が低下する。
+しかしアプリケーションが独自にキャッシングを行っているような 特別な場合には役に立つ。 ファイルの I/O はユーザー空間バッファに対して直接行われる。
+\fBO_DIRECT\fP フラグ自身はデータを同期で転送しようとはするが、 \fBO_SYNC\fP
+フラグのようにデータと必要なメタデータの転送が保証されるわけではない。同期 I/O を保証するためには、 \fBO_DIRECT\fP に加えて
+\fBO_SYNC\fP を使用しなければならない。下記の「注意」の節の議論も参照。
.sp
ブロックデバイスに対する似通った意味のインターフェースが \fBraw\fP(8) で説明されている (但し、このインタフェースは非推奨である)。
.TP
\fBO_NOATIME\fP (Linux 2.6.8 以降)
.\" The O_NOATIME flag also affects the treatment of st_atime
.\" by mmap() and readdir(2), MTK, Dec 04.
-Do not update the file last access time (\fIst_atime\fP in the inode) when the
-file is \fBread\fP(2). This flag is intended for use by indexing or backup
-programs, where its use can significantly reduce the amount of disk
-activity. This flag may not be effective on all file systems. One example
-is NFS, where the server maintains the access time.
+ファイルに対して \fBread\fP(2) が実行されたときに、最終アクセス時刻 (inode の \fIst_atime\fP) を更新しない。
+このフラグはインデックス作成やバックアッププログラムで使うことを意図している。 これを使うとディスクに対する操作を大幅に減らすことができる。
+このフラグは全てのファイルシステムに対して有効であるわけではない。 その一例が NFS であり、サーバがアクセス時刻を管理している。
.TP
\fBO_NOCTTY\fP
-If \fIpathname\fP refers to a terminal device\(emsee \fBtty\fP(4)\(emit will not
-become the process's controlling terminal even if the process does not have
-one.
+\fIpathname\fP が端末 (terminal) デバイス \(em \fBtty\fP(4) 参照 \(em を指している
+場合に、たとえそのプロセスが制御端末を持っていなくても、オープンしたファイル
+は制御端末にはならない。
.TP
\fBO_NOFOLLOW\fP
.\" The headers from glibc 2.0.100 and later include a
.PP
NFS を実現しているプロトコルには多くの不備があり、特に \fBO_SYNC\fP と \fBO_NDELAY\fP に影響する。
-POSIX provides for three different variants of synchronized I/O,
-corresponding to the flags \fBO_SYNC\fP, \fBO_DSYNC\fP, and \fBO_RSYNC\fP. Currently
-(2.6.31), Linux only implements \fBO_SYNC\fP, but glibc maps \fBO_DSYNC\fP and
-\fBO_RSYNC\fP to the same numerical value as \fBO_SYNC\fP. Most Linux file
-systems don't actually implement the POSIX \fBO_SYNC\fP semantics, which
-require all metadata updates of a write to be on disk on returning to user
-space, but only the \fBO_DSYNC\fP semantics, which require only actual file
-data and metadata necessary to retrieve it to be on disk by the time the
-system call returns.
+POSIX では、3 種類の同期 I/O が提供されており、 \fBO_SYNC\fP, \fBO_DSYNC\fP, \fBO_RSYNC\fP
+フラグがこれに対応するものである。 今のところ (カーネル 2.6.31)、 Linux では \fBO_SYNC\fP だけが実装されているが、 glibc
+は \fBO_DSYNC\fP と \fBO_RSYNC\fP に \fBO_SYNC\fP と同じ数値を割り当てている。 ほとんどの Linux
+のファイルシステムは、実際には POSIX の \fBO_SYNC\fP の動作ではなく \fBO_DSYNC\fP の動作だけを実装している。 POSIX の
+\fBO_SYNC\fP では、 \fBopen\fP() がユーザ空間に返る際に、書き込みに関する全てのメタデータの
+更新がディスクに書き込まれている必要がある。 一方、 \fBO_DSYNC\fP では、 \fBopen\fP()
+が返るまでに、実際のファイルのデータとそのデータを取得するために 必要なメタデータだけがディスクに書き込まれていればよい。
\fBopen\fP() はスペシャルファイルをオープンすることができるが、 \fBcreat\fP() でスペシャルファイルを作成できない点に注意すること。
代わりに \fBmknod\fP(2) を使用する。
ファイルの \fIst_ctime\fP と \fIst_mtime\fP フィールドが現在時刻に設定される。
.SS O_DIRECT
.LP
-The \fBO_DIRECT\fP flag may impose alignment restrictions on the length and
-address of user\-space buffers and the file offset of I/Os. In Linux
-alignment restrictions vary by file system and kernel version and might be
-absent entirely. However there is currently no file system\-independent
-interface for an application to discover these restrictions for a given file
-or file system. Some file systems provide their own interfaces for doing
-so, for example the \fBXFS_IOC_DIOINFO\fP operation in \fBxfsctl\fP(3).
+\fBO_DIRECT\fP フラグを使用する場合、ユーザ空間バッファの長さやアドレス、 I/O
+のファイルオフセットに関してアラインメントの制限が課されることがある。 Linux では、アラインメントの制限はファイルシステムやカーネルのバージョンに
+よって異なり、全く制限が存在しない場合もある。 しかしながら、現在のところ、指定されたファイルやファイルシステムに対して
+こうした制限があるかを見つけるための、アプリケーション向けのインタフェースで ファイルシステム非依存のものは存在しない。
+いくつかのファイルシステムでは、制限を確認するための独自のインタフェースが 提供されている。例えば、 \fBxfsctl\fP(3) の
+\fBXFS_IOC_DIOINFO\fP 命令である。
.LP
Linux 2.4 では、転送サイズ、 ユーザーバッファのアラインメント、ファイルオフセットは、
ファイルシステムの論理ブロックサイズの倍数でなければならない。 Linux 2.6 では、512 バイトごとの境界に配置されていれば充分である。
.LP
-\fBO_DIRECT\fP I/Os should never be run concurrently with the \fBfork\fP(2)
-system call, if the memory buffer is a private mapping (i.e., any mapping
-created with the \fBmmap\fP(2) \fBMAP_PRIVATE\fP flag; this includes memory
-allocated on the heap and statically allocated buffers). Any such I/Os,
-whether submitted via an asynchronous I/O interface or from another thread
-in the process, should be completed before \fBfork\fP(2) is called. Failure
-to do so can result in data corruption and undefined behavior in parent and
-child processes. This restriction does not apply when the memory buffer for
-the \fBO_DIRECT\fP I/Os was created using \fBshmat\fP(2) or \fBmmap\fP(2) with the
-\fBMAP_SHARED\fP flag. Nor does this restriction apply when the memory buffer
-has been advised as \fBMADV_DONTFORK\fP with \fBmadvise\fP(2), ensuring that it
-will not be available to the child after \fBfork\fP(2).
+メモリバッファがプライベートマッピング (\fBmmap\fP(2) の \fBMAP_PRIVATE\fP
+フラグで作成されたマッピング) の場合には、\fBO_DIRECT\fP I/O は
+\fBfork\fP(2) システムコールと同時に決して実行すべきではない
+(プライベートマッピングには、ヒープ領域に割り当てられたメモリや静的に
+割り当てたバッファも含まれる)。非同期 I/O インターフェース (AIO) 経由
+やプロセス内の他のスレッドから発行された、このような I/O は、
+\fBfork\fP(2) が呼び出される前に完了されるべきである。
+そうしなかった場合、データ破壊や、親プロセスや子プロセスでの予期しない
+動作が起こる可能性がある。
+\fBO_DIRECT\fP I/O 用のメモリバッファが \fBshmat\fP(2) や\fBMAP_SHARED\fP フラグ
+付きの \fBmmap\fP(2) で作成された場合には、この制限はあてはまらない。
+\fBmadvise\fP(2) でメモリバッファにアドバイス \fBMADV_DONTFORK\fP が設定され
+ている場合にも、この制限はあてはまらない(\fBMADV_DONTFORK\fP はそのメモリ
+バッファが \fBfork\fP(2) 後に子プロセスからは利用できないことを保証するも
+のである)。
.LP
\fBO_DIRECT\fP フラグは SGI IRIX で導入された。SGI IRIX にも Linux 2.4 と同様の (ユーザーバッファの)
アラインメントの制限がある。 また、IRIX には適切な配置とサイズを取得するための \fBfcntl\fP(2) コールがある。 FreeBSD 4.x
In the absence of any errors, or if \fBread\fP() does not check for errors, a
\fBread\fP() with a \fIcount\fP of 0 returns zero and has no other effects.
-If \fIcount\fP is greater than \fBSSIZE_MAX\fP, the result is unspecified.
+\fIcount\fP が \fBSSIZE_MAX\fP より大きければ、結果は規定できない。
.SH 返り値
成功した場合、読み込んだバイト数を返す (0 はファイルの終りを意味する)。 ファイル位置はこの数だけ進められる。
この数が要求した数より小さかったとしてもエラーではない; 例えば今すぐには実際にそれだけの数しかない場合 (ファイルの最後に近いのかも
さらなる情報は \fBtimerfd_create\fP(2) を参照のこと。
.TP
\fBEIO\fP
-I/O error. This will happen for example when the process is in a background
-process group, tries to read from its controlling terminal, and either it is
-ignoring or blocking \fBSIGTTIN\fP or its process group is orphaned. It may
-also occur when there is a low\-level I/O error while reading from a disk or
-tape.
+I/O エラー。これは例えばプロセスがバックグランド・プロセスグループで、それを制御している端末から読み込もうとし、 \fBSIGTTIN\fP が無視
+(ignore) または禁止 (blocking) されている場合や、 そのプロセスグループが孤立 (orphan) している場合に起こる。
+またディスクやテープを読んでいる時に低レベル I/O エラー が発生した場合にも起こる。
.TP
\fBEISDIR\fP
\fIfd\fP がディレクトリを参照している。
\fBpreadv\fP(), \fBpwritev\fP(): 非標準だが、最近の BSD にも存在する。
.SH 注意
-.SS "Linux notes"
+.SS "Linux での注意"
POSIX.1\-2001 では、 \fIiov\fP で渡すことができる要素数に上限を設ける実装が認められている。 実装は、
\fI<limits.h>\fP の \fBIOV_MAX\fP を定義することや、実行時に \fIsysconf(_SC_IOV_MAX)\fP
の返り値経由で、この上限を広告することができる。 Linux では、この仕組みにより広告される上限は 1024 であり、
.SH 準拠
C89, C99.
.SH 注意
-Note that \fBfclose\fP() only flushes the user\-space buffers provided by the C
-library. To ensure that the data is physically stored on disk the kernel
-buffers must be flushed too, for example, with \fBsync\fP(2) or \fBfsync\fP(2).
+\fBfclose\fP() は C ライブラリで提供されたユーザー空間バッファをフラッシュするだけで ある点に注意すること。
+データを確実に物理的にディスクに記録するためには カーネルバッファも (\fBsync\fP(2) や \fBfsync\fP(2) を用いて)
+フラッシュしなければならない。
.SH 関連項目
\fBclose\fP(2), \fBfcloseall\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBsetbuf\fP(3)
.SH この文書について
.\" Verified on: Solaris 8.
標準では、入力ストリームに対する動作は規定されていない。 他のほとんどの実装は Linux と同じ動作をする。
.SH 注意
-Note that \fBfflush\fP() only flushes the user\-space buffers provided by the C
-library. To ensure that the data is physically stored on disk the kernel
-buffers must be flushed too, for example, with \fBsync\fP(2) or \fBfsync\fP(2).
+\fBfflush\fP() は、 C ライブラリが与えているユーザー空間のバッファしかフラッシュしない。
+データが物理的にディスクに保存されることを保証したければ、 カーネルバッファもフラッシュしなければならない。 これには例えば \fBsync\fP(2) や
+\fBfsync\fP(2) を用いる。
.SH 関連項目
\fBfsync\fP(2), \fBsync\fP(2), \fBwrite\fP(2), \fBfclose\fP(3), \fBfopen\fP(3),
\fBsetbuf\fP(3), \fBunlocked_stdio\fP(3)
\fBfopen\fP() 関数と \fBfreopen\fP() 関数は C89に準拠している。 \fBfdopen\fP() 関数は POSIX.1\-1990
に準拠している。
.SH 注意
-.SS "Glibc notes"
+.SS "glibc での注意"
GNU C ライブラリでは、 \fImode\fP に指定できる文字列として、以下の拡張が行われている:
.TP
\fBc\fP (glibc 2.3.3 以降)
ただし \fBrewind\fP() ではストリームに対するエラー表示子 (error indicator) も同時に クリアされる (
\fBclearerr\fP(3) を見よ)。
.PP
-The \fBfgetpos\fP() and \fBfsetpos\fP() functions are alternate interfaces
-equivalent to \fBftell\fP() and \fBfseek\fP() (with \fIwhence\fP set to
-\fBSEEK_SET\fP), setting and storing the current value of the file offset into
-or from the object referenced by \fIpos\fP. On some non\-UNIX systems, an
-\fIfpos_t\fP object may be a complex object and these routines may be the only
-way to portably reposition a text stream.
+\fBfgetpos\fP() 関数と \fBfsetpos\fP() 関数は、それぞれ \fBftell\fP() と \fBfseek\fP() で
+\fIwhence\fP に \fBSEEK_SET\fP を指定した場合と同様の機能を、異なるインターフェースで提供する。 \fBfgetpos\fP()
+はファイルオフセットの現在の値を \fIpos\fP が参照するオブジェクトに保存し、 \fBfsetpos\fP() はファイルオフセットを \fIpos\fP
+に設定する。 UNIX 以外のシステムにおいては、 \fIfpos_t\fP が構造体などの複雑なオブジェクトになっていて、これらのルーチンがテキス
+トストリームでファイル位置を変更する方法のうち、移植性のある唯一のもの になっている場合もある。
.SH 返り値
\fBrewind\fP() は返り値を持たない。 \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() は成功すると 0
を返す。 \fBftell\fP() は現在のオフセットを返す。失敗した場合は返り値は \-1 となり、 \fIerrno\fP にエラーを示す値がセットされる。
a nonstandard extension) via the \fBa\fP character. This feature seems to be
present at least as far back as glibc 2.0.
.PP
-It is not available if the program is compiled with \fIgcc \-std=c99\fP or \fIgcc
-\-D_ISOC99_SOURCE\fP (unless \fB_GNU_SOURCE\fP is also specified), in which case
-the \fBa\fP is interpreted as a specifier for floating\-point numbers (see
-above).
+この修飾子は \fIgcc \-std=c99\fP や \fIgcc \-D_ISOC99_SOURCE\fP でコンパイルしたプログラムでは
+(\fB_GNU_SOURCE\fP も同時に指定していない場合) 利用できない。この場合、 \fBa\fP は (上述の通り)
+浮動小数点数を示す変換指定子と解釈される。
バージョン 2.7 以降では、glibc は \fBa\fP 修飾子と同じ目的で \fBm\fP 修飾子も提供している。 \fBm\fP 修飾子は以下の利点がある。
.IP * 2
.IP *
浮動小数点変換指定子としての \fB%a\fP との紛らわしさが避けられる (また \fIgcc \-std=c99\fP などの影響も避けられる)。
.IP *
-It is specified in the POSIX.1\-2008 standard.
+POSIX.1\-2008 標準で規定されている。
.SH バグ
全ての関数は、完全に C89 に準拠している。しかし 追加で \fBq\fP と \fBa\fP 指定子が提供されており、同様に \fBL\fP と \fBl\fP
指定子の付加的な振る舞いもある。後者は、 C89 で定義された指定子の振る舞いを変更するものなので、 バグとみなされるかもしれない。
プログラムの終了の前に 現在開いているすべてのファイルは閉じられる (その結果、すべての出力ストリームはフラッシュされる)。 プログラムの停止に
\fBabort\fP(3) のような他の方法を用いた場合には、 ファイルが正しく閉じられる保証はない。
.PP
-At program startup, three text streams are predefined and need not be opened
-explicitly: \fIstandard input\fP (for reading conventional input), \fIstandard
-output\fP (for writing conventional input), and \fIstandard error\fP (for writing
-diagnostic output). These streams are abbreviated \fIstdin\fP,\fIstdout\fP and
-\fIstderr\fP. When opened, the standard error stream is not fully buffered;
-the standard input and output streams are fully buffered if and only if the
-streams do not refer to an interactive device.
+プログラムの起動時に 3 個のテキストストリームが予め定義されており、 それらは明示的に開く必要がない。 \fI標準入力 (standard
+input)\fP (通常の入力を読み取るのに使う)、 \fI標準出力 (standard output)\fP (通常の出力を書き込むのに使う)、
+\fI標準エラー出力 (standard error)\fP (診断出力を書き込むのに使う) である。 これらのストリームは \fIstdin\fP,
+\fIstdout\fP, \fIstderr\fP と短縮して表現される。 オープンされたときには、 標準エラーストリームは 完全にはバッファリングされていない。
+標準入力ストリームと標準出力ストリームは、 ストリームがインタラクティブなデバイスを参照していなければ、 完全にバッファリングされている。
.PP
端末デバイスを参照する出力ストリームは、 デフォルトでは常に行単位でバッファリングされている。 ただしそのようなストリームにおけるバッファ内の出力は、
端末デバイスを参照している入力ストリームからの読み込みがあるたびに、 自動的に書き込まれる。 出力端末に行の一部を書き込んだ後で大量の計算を行う場合、
これらの名前は、現在の定義を \fB#undef\fP で削除しない限り、再利用することはできない。 マクロ関数の関数版として、 \fBfeof\fP,
\fBferror\fP, \fBclearerr\fP, \fBfileno\fP, \fBgetc\fP, \fBgetchar\fP, \fBputc\fP, \fBputchar\fP
がある。 マクロの定義が明示的に消去されている場合には、 これらを使用することになるだろう。
-.SS "List of functions"
+.SS 関数のリスト
.TS
;
lb lb
</TR><TR class="over80"><TD>build/ja/man3/syslog.3</TD><TD>2/93</TD><TD>97.85</TD>
</TR><TR class="over80"><TD>build/ja/man4/wavelan.4</TD><TD>4/41</TD><TD>90.24</TD>
</TR><TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>stdio</B></TD></TR>
-<TR class="over80"><TD>build/ja/man3/fclose.3</TD><TD>1/25</TD><TD>96.00</TD>
-</TR><TR class="over80"><TD>build/ja/man3/fflush.3</TD><TD>1/28</TD><TD>96.43</TD>
-</TR><TR class="over80"><TD>build/ja/man3/fopen.3</TD><TD>2/67</TD><TD>97.01</TD>
-</TR><TR><TD>build/ja/man3/fopencookie.3</TD><TD>33/98</TD><TD>66.33</TD>
-</TR><TR class="over80"><TD>build/ja/man3/fseek.3</TD><TD>1/34</TD><TD>97.06</TD>
-</TR><TR class="over80"><TD>build/ja/man2/link.2</TD><TD>5/61</TD><TD>91.80</TD>
-</TR><TR class="over80"><TD>build/ja/man2/llseek.2</TD><TD>2/29</TD><TD>93.10</TD>
-</TR><TR class="over80"><TD>build/ja/man2/lseek.2</TD><TD>8/60</TD><TD>86.67</TD>
-</TR><TR class="over80"><TD>build/ja/man2/open.2</TD><TD>10/152</TD><TD>93.42</TD>
-</TR><TR class="over80"><TD>build/ja/man3/printf.3</TD><TD>10/162</TD><TD>93.83</TD>
-</TR><TR class="over80"><TD>build/ja/man2/read.2</TD><TD>5/44</TD><TD>88.64</TD>
-</TR><TR class="over80"><TD>build/ja/man2/readv.2</TD><TD>1/52</TD><TD>98.08</TD>
-</TR><TR class="over80"><TD>build/ja/man2/rename.2</TD><TD>3/62</TD><TD>95.16</TD>
-</TR><TR class="over80"><TD>build/ja/man3/scanf.3</TD><TD>7/140</TD><TD>95.00</TD>
-</TR><TR class="over80"><TD>build/ja/man3/setbuf.3</TD><TD>2/42</TD><TD>95.24</TD>
-</TR><TR class="over80"><TD>build/ja/man3/stdio.3</TD><TD>2/83</TD><TD>97.59</TD>
-</TR><TR class="over80"><TD>build/ja/man2/symlink.2</TD><TD>3/57</TD><TD>94.74</TD>
+<TR><TD>build/ja/man3/fopencookie.3</TD><TD>33/98</TD><TD>66.33</TD>
+</TR><TR class="over80"><TD>build/ja/man2/link.2</TD><TD>3/61</TD><TD>95.08</TD>
+</TR><TR class="over80"><TD>build/ja/man2/llseek.2</TD><TD>1/29</TD><TD>96.55</TD>
+</TR><TR class="over80"><TD>build/ja/man2/lseek.2</TD><TD>7/60</TD><TD>88.33</TD>
+</TR><TR class="over80"><TD>build/ja/man2/open.2</TD><TD>2/152</TD><TD>98.68</TD>
+</TR><TR class="over80"><TD>build/ja/man3/printf.3</TD><TD>1/162</TD><TD>99.38</TD>
+</TR><TR class="over80"><TD>build/ja/man2/read.2</TD><TD>2/44</TD><TD>95.45</TD>
+</TR><TR class="over80"><TD>build/ja/man2/rename.2</TD><TD>2/62</TD><TD>96.77</TD>
+</TR><TR class="over80"><TD>build/ja/man3/scanf.3</TD><TD>3/140</TD><TD>97.86</TD>
+</TR><TR class="over80"><TD>build/ja/man2/symlink.2</TD><TD>2/57</TD><TD>96.49</TD>
</TR><TR><TD>build/ja/man7/symlink.7</TD><TD>46/66</TD><TD>30.30</TD>
-</TR><TR class="over80"><TD>build/ja/man2/write.2</TD><TD>3/53</TD><TD>94.34</TD>
+</TR><TR class="over80"><TD>build/ja/man2/write.2</TD><TD>2/53</TD><TD>96.23</TD>
</TR><TR><TD ALIGN="center" COLSPAN=3 BGCOLOR="Yellow"><B>stdlib</B></TD></TR>
<TR class="over80"><TD>build/ja/man3/atexit.3</TD><TD>1/37</TD><TD>97.30</TD>
</TR><TR class="over80"><TD>build/ja/man3/atof.3</TD><TD>2/21</TD><TD>90.48</TD>