off_t lseek(int fd, off_t offset, int whence);
This system call implements the POSIX lseek function, which changes the current file offset in a file descriptor.
- fd
- The file desriptor to reposition.
- offset
- The file offset to seek to relative to the base specified by whence.
- whence
- The base from which offset is relative:
- SEEK_SET: Seek relative to the beginning of the file.
- SEEK_CUR: Seek relative to the current position.
- SEEK_END: Seek relative to the end of the file.
Returns the new absolute file position if successful, or -1 on error, in which case errno indicates the error.