[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    llseek(2) manual page Table of Contents

Name

llseek - move extended read/write file pointer

Synopsis


#include <sys/types.h>
#include <unistd.h>

offset_t llseek(int fildes, offset_t offset, int whence);

Description

llseek() sets the 64-bit extended file pointer associated with the open file descriptor specified by fildes as follows:

On success, llseek() returns the resulting pointer location, as measured in bytes from the beginning of the file.

Return Values

Upon successful completion, the resulting file pointer is returned. Remote file descriptors are the only ones that allow negative file pointers. Otherwise, a value of -1 is returned and errno is set to indicate the error.

Errors

llseek() fails and the file pointer remains unchanged if one or more of the following are true:

EBADF
fildes is not an open file descriptor.
EINVAL
whence is not SEEK_SET, SEEK_CUR, or SEEK_END.
EINVAL
offset is not a valid offset for this file system type.
EINVAL
fildes is not a remote file descriptor, and the resulting file pointer would be negative.
ESPIPE
fildes is associated with a pipe or fifo.

Some devices are incapable of seeking. The value of the file pointer associated with such a device is undefined.

Limitations

Although each file has a 64-bit file pointer associated with it, existing file system types do not support the full range of 64-bit offsets. In particular, non-device files remain limited to offsets of less than two gigabytes. Device drivers may support offsets of up to 1024 gigabytes for device special files.

See Also

creat(2) , dup(2) , fcntl(2) , lseek(2) , open(2)


Table of Contents