OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / lseek.2
index cf1dec7..041bdbd 100644 (file)
@@ -107,17 +107,13 @@ Linux バージョン 3.1 以降では、 \fIwhence\fP に以下の値も指定
 .\" https://lkml.org/lkml/2011/4/22/79
 .\" http://lwn.net/Articles/440255/
 .\" http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
-For the purposes of these operations, a hole is a sequence of zeros that
-(normally) has not been allocated in the underlying file storage.  However,
-a filesystem is not obliged to report holes, so these operations are not a
-guaranteed mechanism for mapping the storage space actually allocated to a
-file.  (Furthermore, a sequence of zeros that actually has been written to
-the underlying storage may not be reported as a hole.)  In the simplest
-implementation, a filesystem can support the operations by making
-\fBSEEK_HOLE\fP always return the offset of the end of the file, and making
-\fBSEEK_DATA\fP always return \fIoffset\fP (i.e., even if the location referred to
-by \fIoffset\fP is a hole, it can be considered to consist of data that is a
-sequence of zeros).
+これらの操作の目的としては、 ホールは (通常は) バックエンドのファイルストレージには割り当てられていない連続する 0 の列である。
+しかし、ファイルシステムにはホールを報告する義務はなく、 そのため、 これらの操作は、
+ファイルに実際に割り当てられたストレージ領域をマッピングする方法としては確実性のある仕組みではない。
+(また、バックエンドのストレージに実際に書き込まれた連続する 0 の列はホールとして報告されないこともある。) 最も単純な実装としては、
+\fBSEEK_HOLE\fP は常にファイル末尾のオフセットを返すようにし、 \fBSEEK_DATA\fP は常に \fIoffset\fP を返すようにすることで、
+ファイルシステムはこれらの操作をサポートすることができる (\fBSEEK_DATA\fP は常に \fIoffset\fP を返すというのは、 \fIoffset\fP
+が参照する場所がホールであったとしても、 連続する 0 の列のデータで構成されているとみなすということである)。
 
 \fI<unistd.h>\fP から \fBSEEK_DATA\fP と \fBSEEK_HOLE\fP の定義を得るには、 機能検査マクロ
 \fB_GNU_SOURCE\fP を定義しなければならない。