The system_lseek function sets the file position of a file. This function affects where data from system_fread or system_fwrite is read or written.
int system_lseek(SYS_FILE fd, int offset, int whence);
The offset, in bytes, of the new position from the beginning of the file if the operation succeeded, or -1 if the operation failed.
SYS_FILE fd is the platform-independent file descriptor.
int offset is a number of bytes relative to whence. It may be negative.
int whence is one of the following constants:
SEEK_SET, from the beginning of the file.
SEEK_CUR, from the current file position.
SEEK_END, from the end of the file.