The manual page for lseek()
says:
lseek() 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.
At the error section it says:
EINVAL whence is not valid. Or: the resulting file offset would be negative, or beyond the end of a seekable device.
I'm unsure how to interpret the lseek
manual page as it doesn't mention MTD.
Assuming that the MTD
has been opened with read and write permission, how would lseek()
respond when seeking past EOF when whence
is SEEK_SET
for MTD's?