Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/lseek.2
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | |||||
.Dv SEEK_HOLE . | .Dv SEEK_HOLE . | ||||
File systems are allowed to expose ranges of zeros with | File systems are allowed to expose ranges of zeros with | ||||
.Dv SEEK_HOLE , | .Dv SEEK_HOLE , | ||||
but not required to. | but not required to. | ||||
Applications can use | Applications can use | ||||
.Dv SEEK_HOLE | .Dv SEEK_HOLE | ||||
to optimise their behavior for ranges of zeros, but must not depend on it to | to optimise their behavior for ranges of zeros, but must not depend on it to | ||||
find all such ranges in a file. | find all such ranges in a file. | ||||
Each file is presented as having a zero-size virtual hole at the very | |||||
end of the file. | |||||
The existence of a hole at the end of every data region allows for easy | The existence of a hole at the end of every data region allows for easy | ||||
programming and implies that a virtual hole exists at the end of the file. | programming and also provides compatibility to the original imlementation | ||||
in Solaris. | |||||
It also causes the current file size (i.e. end-of-file offset) to be returned | |||||
to indicate that there are no more holes past the supplied | |||||
.Fa offset . | |||||
Applications should use | Applications should use | ||||
.Fn fpathconf _PC_MIN_HOLE_SIZE | .Fn fpathconf _PC_MIN_HOLE_SIZE | ||||
or | or | ||||
.Fn pathconf _PC_MIN_HOLE_SIZE | .Fn pathconf _PC_MIN_HOLE_SIZE | ||||
to determine if a file system supports | to determine if a file system supports | ||||
.Dv SEEK_HOLE . | .Dv SEEK_HOLE . | ||||
See | See | ||||
.Xr pathconf 2 . | .Xr pathconf 2 . | ||||
Show All 27 Lines | |||||
argument | argument | ||||
is not a proper value | is not a proper value | ||||
or the resulting file offset would | or the resulting file offset would | ||||
be negative for a non-character special file. | be negative for a non-character special file. | ||||
.It Bq Er ENXIO | .It Bq Er ENXIO | ||||
For | For | ||||
.Dv SEEK_DATA , | .Dv SEEK_DATA , | ||||
there are no more data regions past the supplied offset. | there are no more data regions past the supplied offset. | ||||
For | Due to existence of the hole at the end of the file, for | ||||
.Dv SEEK_HOLE , | .Dv SEEK_HOLE | ||||
there are no more holes past the supplied offset. | this error is only returned when the | ||||
.Fa offset | |||||
already points to the end-of-file position. | |||||
.It Bq Er EOVERFLOW | .It Bq Er EOVERFLOW | ||||
The resulting file offset would be a value which cannot be represented | The resulting file offset would be a value which cannot be represented | ||||
correctly in an object of type | correctly in an object of type | ||||
.Fa off_t . | .Fa off_t . | ||||
.It Bq Er ESPIPE | .It Bq Er ESPIPE | ||||
The | The | ||||
.Fa fildes | .Fa fildes | ||||
argument | argument | ||||
Show All 20 Lines |