.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
.\" Updated 2013-05-07, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.TH LSEEK 2 2013\-03\-27 Linux "Linux Programmer's Manual"
+.TH LSEEK 2 2014\-01\-22 Linux "Linux Programmer's Manual"
.SH 名前
lseek \- ファイルの読み書きオフセットの位置を変える
.SH 書式
.\" 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 を定義しなければならない。
+
+The \fBSEEK_HOLE\fP and \fBSEEK_DATA\fP operations are supported for the following
+filesystems:
+.IP * 3
+Btrfs (Linux 3.1 以降)
+.IP * 3
+.\" commit 93862d5e1ab875664c6cc95254fc365028a48bb1
+OCFS (Linux 3.2 以降)
+.IP *
+XFS (Linux 3.5 以降)
+.IP *
+ext4 (Linux 3.8 以降)
+.IP *
+tmpfs (Linux 3.8 以降)
.SH 返り値
成功した場合、 \fBlseek\fP() は結果のファイル位置をファイルの先頭からのバイト数で返す。 エラーの場合、値 \fI(off_t)\ \-1\fP
が返され、 \fIerrno\fP にエラーが指示される。
\fBdup\fP(2), \fBfork\fP(2), \fBopen\fP(2), \fBfseek\fP(3), \fBlseek64\fP(3),
\fBposix_fallocate\fP(3)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.64 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。