\fBwrite\fP() が 1 バイトも書き込まないうちにシグナルハンドラにより割り込まれた場合、 \fBwrite\fP() はエラー \fBEINTR\fP
で失敗する。 1バイトでも書き込んだ後で割り込まれた場合には、 \fBwrite\fP() は成功し、書き込んだバイト数を返す。
.SH バグ
-According to POSIX.1\-2008/SUSv4 Section XSI 2.9.7 ("Thread Interactions with
-Regular File Operations"):
+POSIX.1\-2008/SUSv4 セクション XSI 2.9.7 ("Thread Interactions with Regular File
+Operations") によると、
.RS 4
-All of the following functions shall be atomic with respect to each other in
-the effects specified in POSIX.1\-2008 when they operate on regular files or
-symbolic links: ...
+以下のすべての関数では、 通常ファイルもしくはシンボリックリンクに対する操作では POSIX.1\-2008
+で規定された効果が互いにアトミックに行われなければならない: ...
.RE
.\" http://thread.gmane.org/gmane.linux.kernel/1649458
.\" Date: Mon Mar 3 09:36:58 2014 -0800
.\"
.\" vfs: atomic f_pos accesses as per POSIX
-Among the APIs subsequently listed are \fBwrite\fP() and \fBwritev\fP(2). And
-among the effects that should be atomic across threads (and processes) are
-updates of the file offset. However, on Linux before version 3.14, this was
-not the case: if two processes that share an open file description (see
-\fBopen\fP(2)) perform a \fBwrite\fP() (or \fBwritev\fP(2)) at the same time, then
-the I/O operations were not atomic with respect updating the file offset,
-with the result that the blocks of data output by the two processes might
-(incorrectly) overlap. This problem was fixed in Linux 3.14.
+この後に書かれている API の中に \fBwrite\fP() と \fBwritev\fP(2) である。 スレッド(やプロセス)
+間でアトミックに適用することが求められる効果の一つとして、 ファイルオフセットの更新がある。 しかしながら、 バージョン 3.14 より前の Linux
+では、 この限りではない。 オープンファイル記述 (open file description) を共有する 2 つのプロセスが同時に
+\fBwrite\fP() (や \fBwritev\fP(2)) を実行した場合、 この I/O 操作ではファイルオフセットの更新に関してはアトミックではなく、
+2 つのプロセスから出力されるデータブロックが (間違って) 重なる可能性がある。 この問題は Linux 3.14 で修正された。
.SH 関連項目
\fBclose\fP(2), \fBfcntl\fP(2), \fBfsync\fP(2), \fBioctl\fP(2), \fBlseek\fP(2), \fBopen\fP(2),
\fBpwrite\fP(2), \fBread\fP(2), \fBselect\fP(2), \fBwritev\fP(2), \fBfwrite\fP(3)