lseek (Debugging with GDB)
From Get docs
Gdb/docs/latest/gdb/lseek
Next: rename, Previous: write, Up: List of Supported Calls [Contents][Index]
lseek
- Synopsis:
long lseek (int fd, long offset, int flag);
- Request:
‘
Flseek,fd,offset,flag’flagis one of:SEEK_SETThe offset is set to
offsetbytes.SEEK_CURThe offset is set to its current location plus
offsetbytes.SEEK_ENDThe offset is set to the size of the file plus
offsetbytes.
- Return value:
On success, the resulting unsigned offset in bytes from the beginning of the file is returned. Otherwise, a value of -1 is returned.
- Errors:
EBADFfdis not a valid open file descriptor.ESPIPEfdis associated with the GDB console.EINVALflagis not a proper value.EINTRThe call was interrupted by the user.