.\" Modified 2003-08-21 by Andries Brouwer <aeb@cwi.nl>
.\" 2011-09-18, mtk, Added SEEK_DATA + SEEK_HOLE
.\"
-.TH LSEEK 2 2011-09-25 "Linux" "Linux Programmer's Manual"
+.TH LSEEK 2 2014-01-22 "Linux" "Linux Programmer's Manual"
.SH NAME
lseek \- reposition read/write file offset
.SH SYNOPSIS
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 file system is not obliged to report holes,
+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 file system can support the operations by making
+a filesystem can support the operations by making
.BR SEEK_HOLE
always return the offset of the end of the file,
and making
.\" https://lkml.org/lkml/2011/4/22/79
.\" http://lwn.net/Articles/440255/
.\" http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
+
+The
+.BR _GNU_SOURCE
+feature test macro must be defined in order to obtain the definitions of
+.BR SEEK_DATA
+and
+.BR SEEK_HOLE
+from
+.IR <unistd.h> .
+
+The
+.BR SEEK_HOLE
+and
+.BR SEEK_DATA
+operations are supported for the following filesystems:
+.IP * 3
+Btrfs (since Linux 3.1)
+.IP * 3
+OCFS (since Linux 3.2)
+.\" commit 93862d5e1ab875664c6cc95254fc365028a48bb1
+.IP *
+XFS (since Linux 3.5)
+.IP *
+ext4 (since Linux 3.8)
+.IP *
+tmpfs (since Linux 3.8)
.SH RETURN VALUE
Upon successful completion,
.BR lseek ()
Or: the resulting file offset would be negative,
or beyond the end of a seekable device.
.\" Some systems may allow negative offsets for character devices
-.\" and/or for remote file systems.
+.\" and/or for remote filesystems.
.TP
.B EOVERFLOW
.\" HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
.BR fseek (3),
.BR lseek64 (3),
.BR posix_fallocate (3)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.