.th seek IV 4/21/86
.sh NAME
seek - move read/write pointer
.sh SYNOPSIS
seek(fildes, offset, ptrname)
.br
int fildes, offset, ptrname;
.ft R
.sh DESCRIPTION
The file descriptor refers to a file open for reading or writing.  The
read (resp.  write) pointer for the file is set as follows:
.s3
.lp +6 3
if
ptrname
is 0, the pointer is set to
offset.
.s3
.lp +6 3
if
ptrname
is 1, the pointer is set to its current location plus
offset.
.s3
.lp +6 3
if
ptrname
is 2, the pointer is set to the size of the
file plus
offset.
.s3
.lp +6 3
if
ptrname
is 3, 4 or 5,
the meaning is as above for
0, 1 and 2 except that
the offset is
multiplied by 512.
.s3
.i0
If
ptrname
is 0 or 3,
offset
is unsigned,
otherwise
it is signed.
.sh "SEE ALSO"
open (IV), creat (IV)
.sh DIAGNOSTICS
The error bit (c-bit) is set for an undefined file descriptor.  From C,
a -1 return indicates an error, 0 for success.

