|
Lines 28-34
Link Here
|
| 28 |
.\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 |
28 |
.\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 |
| 29 |
.\" $FreeBSD$ |
29 |
.\" $FreeBSD$ |
| 30 |
.\" |
30 |
.\" |
| 31 |
.Dd April 5, 2007 |
31 |
.Dd November 21, 2011 |
| 32 |
.Dt LSEEK 2 |
32 |
.Dt LSEEK 2 |
| 33 |
.Os |
33 |
.Os |
| 34 |
.Sh NAME |
34 |
.Sh NAME |
|
Lines 113-122
of the existing end-of-file of the file.
Link Here
|
| 113 |
If data is later written |
113 |
If data is later written |
| 114 |
at this point, subsequent reads of the data in the gap return |
114 |
at this point, subsequent reads of the data in the gap return |
| 115 |
bytes of zeros (until data is actually written into the gap). |
115 |
bytes of zeros (until data is actually written into the gap). |
| 116 |
.Pp |
116 |
However, the |
| 117 |
Some devices are incapable of seeking. |
117 |
.Fn lseek |
| 118 |
The value of the pointer |
118 |
system call does not, by itself, extend the size of a file. |
| 119 |
associated with such a device is undefined. |
|
|
| 120 |
.Pp |
119 |
.Pp |
| 121 |
A |
120 |
A |
| 122 |
.Qq hole |
121 |
.Qq hole |
|
Lines 197-209
is associated with a pipe, socket, or FIFO.
Link Here
|
| 197 |
The |
196 |
The |
| 198 |
.Fn lseek |
197 |
.Fn lseek |
| 199 |
system call is expected to conform to |
198 |
system call is expected to conform to |
| 200 |
.St -p1003.1-90 . |
199 |
.St -p1003.1-2008 . |
|
|
200 |
.Pp |
| 201 |
The |
| 202 |
.Dv SEEK_HOLE |
| 203 |
and |
| 204 |
.Dv SEEK_DATA |
| 205 |
directives, along with the |
| 206 |
.Er ENXIO |
| 207 |
error, are extensions to that specification. |
| 201 |
.Sh HISTORY |
208 |
.Sh HISTORY |
| 202 |
The |
209 |
The |
| 203 |
.Fn lseek |
210 |
.Fn lseek |
| 204 |
function appeared in |
211 |
function appeared in |
| 205 |
.At v7 . |
212 |
.At v7 . |
| 206 |
.Sh BUGS |
213 |
.Sh BUGS |
|
|
214 |
If the |
| 215 |
.Fn lseek |
| 216 |
system call is operating on a device which is incapable of seeking, |
| 217 |
it will request the seek operation and return successfully, |
| 218 |
even though no seek was performed. |
| 219 |
Because the |
| 220 |
.Ar offset |
| 221 |
argument will be stored unconditionally in the file descriptor of that device, |
| 222 |
there is no way to confirm, if the seek operation succeeded or not |
| 223 |
(e.g. using the |
| 224 |
.Fn ftell |
| 225 |
function). |
| 226 |
Device types which are known to be incapable of seeking include |
| 227 |
tape drives. |
| 228 |
.Pp |
| 229 |
The |
| 230 |
.Fn lseek |
| 231 |
system call will not detect whether media are present in changeable |
| 232 |
media devices such as DVD or Blu-ray devices. |
| 233 |
A requested seek operation will therefore return sucessfully when no |
| 234 |
medium is present. |
| 235 |
.Pp |
| 207 |
This document's use of |
236 |
This document's use of |
| 208 |
.Fa whence |
237 |
.Fa whence |
| 209 |
is incorrect English, but is maintained for historical reasons. |
238 |
is incorrect English, but is maintained for historical reasons. |