Moves the read-write file pointer.
Standard C Library (libc.a)
off_t lseek ( FileDescriptor, Offset, Whence)
int FileDescriptor, Whence;
off_t Offset;
offset_t llseek (FileDescriptor, Offset, Whence) int FileDescriptor, Whence; offset_t Offset;
off64_t lseek64 (FileDescriptor, Offset, Whence) int FileDescriptor, Whence; off64_t Offset;
The lseek, llseek, and lseek64 subroutines set the read-write file pointer for the open file specified by the FileDescriptor parameter. The lseek subroutine limits the Offset to OFF_MAX.
In the large file enabled programming environment, lseek subroutine is redefined to lseek64.
Upon successful completion, the resulting pointer location, measured in bytes from the beginning of the file, is returned. If either the lseek or llseek subroutines are unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.
The lseek or llseek subroutines are unsuccessful and the file pointer remains unchanged if any of the following are true:
/usr/include/unistd.h | Defines standard macros, data types and subroutines. |
The fcntl (fcntl, dup, or dup2 Subroutine) subroutine, fseek, rewind, ftell, fgetpos, or fsetpos (fseek, fseeko, fseeko64, rewind, ftell, ftello, ftello64, fgetpos, fgetpos64, fsetpos, or fsetpos64 Subroutine) subroutine, open, openx, or creat (open, openx, open64, creat, or creat64 Subroutine) subroutine, read, readx, readv, or readvx subroutine, write, writex, writev, or writevx subroutine.
File Systems and Directories in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.