OSDN Git Service

(split) LDP: Update draft and release (from the previous commit)
[linuxjm/LDP_man-pages.git] / draft / man2 / close.2
index 1622b95..75055c8 100644 (file)
@@ -85,14 +85,11 @@ I/O エラーが発生した。
 .\" SVr4 documents an additional ENOLINK error condition.
 SVr4, 4.3BSD, POSIX.1\-2001.
 .SH 注意
-Not checking the return value of \fBclose\fP()  is a common but nevertheless
-serious programming error.  It is quite possible that errors on a previous
-\fBwrite\fP(2)  operation are first reported at the final \fBclose\fP().  Not
-checking the return value when closing the file may lead to silent loss of
-data.  This can especially be observed with NFS and with disk quota.  Note
-that the return value should only be used for diagnostics.  In particular
-\fBclose\fP()  should not be retried after an \fBEINTR\fP since this may cause a
-reused descriptor from another thread to be closed.
+\fBclose\fP()  の返り値のチェックはよく省略されるが、 これは深刻なプログラミングエラーである。 前の \fBwrite\fP(2)
+処理に関するエラーが最後の \fBclose\fP()  のときになって初めて通知される場合がありうる。 ファイルクローズの際に返り値をチェックしないと、
+気付かないうちにデータを失ってしまうかもしれない。 これは特に NFS
+やディスククォータを使用した場合に見られる。返り値は状態確認用にのみ利用すべき点に注意すること。特に、\fBEINTR\fP 後に \fBclose\fP()
+を再度行うべきではない。なぜなら、これにより、別のスレッドが再利用したディスクリプタをクローズしてしまう可能性があるからだ。
 .PP
 クローズに成功しても、データがディスクに保存されたかどうかは 保証されない (カーネルが書きこみを遅延させることがあるためである)。
 ストリームがクローズされるときにバッファをフラッシュするかどうかは、 ファイルシステムによって異なる。