.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)lseek.2 8.2 (Berkeley) %G%
.Nd reposition read/write file offset
.Fn lseek "int fildes" "off_t offset" "int whence"
function repositions the offset of the file descriptor
according to the directive
repositions the file pointer
the offset is set to its current location plus
the offset is set to the size of the
function allows the file offset to be set beyond the end
of the existing end-of-file of the file. If data is later written
at this point, subsequent reads of the data in the gap return
bytes of zeros (until data is actualy written into the gap).
Some devices are incapable of seeking. The value of the pointer
associated with such a device is undefined.
Upon successful completion,
returns the resulting offset location as measured in bytes from the
a value of -1 is returned and
will fail and the file pointer will remain unchanged if:
is not an open file descriptor.
is associated with a pipe, socket, or FIFO.
is incorrect English, but is maintained for historical reasons.
conforms to IEEE Std 1003.1-1988