https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
The fseek() function shall allow the file-position indicator to be set beyond the end of existing data in the file. If data is later written at this point, subsequent reads of data in the gap shall return bytes with the value 0 until data is actually written into the gap.
We don't support this at the moment; the lseek
syscall fails when the seek offset causes the pointer to move beyond the EOF.
First we need to decide what makes sense in kernel vs. userspace: do we want to implement this behavior all the way into the lseek
syscall, or can we deal with out-of-bounds shenanigans in userspace?
Current behavior:
serenity/Kernel/FileSystem/FileDescription.cpp
Lines 119 to 156 in 8f81d9a
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too