sys_lseek [fs/read_write.c]
Reposition read/write file offset of an open file. The sys_lseek function allows the file offset to be set beyond the end of the file (but this does not change the size of the file). If data is later written at this point, subsequent reads of the data in the gap (a "hole") return null bytes ('\0') until data is actually written into the gap. Arguments
eax | 19
ebx | File descriptor of an open file.
ecx | Value by which the current offset will be moved.
edx | The starting point for the file offset to move. It may be one of the following values:
`SEEK_SET` | `The starting point is the beginning of the file.`
`SEEK_CUR` | `The starting point is the current offset.`
`SEEK_END` | `The starting point is the end of the file.`
Return values If the system call succeeds the return value is the resulting offset location as measured in bytes from the beginning of the file. If the system call fails the return value is one of the following errno values:
`-EBADF` | `ebx is not an open file descriptor.`
`-EOVERFLOW` | `The resulting file offset cannot be represented in the given offset.`
`-EINVAL` | `edx is is not one of SEEK_SET, SEEK_CUR, SEEK_END; or the resulting file offset would be negative, or beyond the end of a seekable device.`
`-ESPIPE` | `ebx is associated with a pipe, socket, or FIFO.`
Remarks n/a Compatibility n/a