NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO
#include <unistd.h>off_t lseek(int fildes, off_t offset, int whence);
MSDOSFS, NFS_CLIENT, UFS
The fildes field contains a file descriptor returned from an open(2POSIX), or dup(2POSIX) system call. The lseek function sets the file pointer associated with fildes as follows:
whence is SEEK_SET (0), the pointer is set to offset bytes.
whence is SEEK_CUR (1), the pointer is set to its current location plus offset.
whence is SEEK_END (2), the pointer is set to the size of the file plus offset.
Upon successful completion, lseek returns the resulting pointer location, as measured in bytes from the beginning of the file; otherwise it returns -1 and sets errno to indicate one of the following error conditions:
fildes is not an open file descriptor.
whence is not SEEK_SET, SEEK_CUR or SEEK_END.
The resulting file pointer would be negative.
Some devices are incapable of seeking. The value of the file pointer associated with this type of device is undefined.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO