LSEEK(2-SVR3) RISC/os Reference Manual LSEEK(2-SVR3)
NAME
lseek - move read/write file pointer
SYNOPSIS
#include <unistd.h>
#include <sys/types.h>
offt lseek (fildes, offset, whence)
int fildes;
offt offset;
int whence;
DESCRIPTION
fildes is a file descriptor returned from a creat, open,
dup, or fcntl system call. lseek sets the file pointer
associated with fildes as specified by the value of the
argument whence. Symbolic constants for whence are defined
in <unistd.h> as follows:
SEEKSET the pointer is set to offset bytes.
SEEKCUR the pointer is set to its current location
plus offset.
SEEKEND the pointer is set to the size of the file
plus offset.
RETURN VALUE
Upon successful completion, the resulting pointer location,
as measured in bytes from the beginning of the file, is
returned. Otherwise, ((off_t)-1) is returned and errno is
set to indicate the error.
ERRORS
lseek will fail and the file pointer will remain unchanged
if one or more of the following are true:
[EBADF] fildes is not an open file
descriptor.
[ESPIPE] fildes is associated with a
pipe or fifo.
[EINVAL and SIGSYS signal] whence is not SEEKSET,
SEEKCUR, or SEEKEND.
Some devices are incapable of seeking. The value of the
file pointer associated with such a device is undefined.
SEE ALSO
creat(2), dup(2), fcntl(2), open(2).
Printed 11/19/92 Page 1