The 2.2.16-lfs kernel patch breaks pread() semantics. When the offset lies beyond end-of-file, standards (SuS V2) say it shall return 0 bytes, but with the patch it returns EOVERFLOW. The bug is in the patch to sys_pread(), these lines: + /* Read starting from beyond the end of file ? */ + if (inode->i_size <= pos) { + ret = -EOVERFLOW; + goto out; + } This should return zero rather than an error. You might argue that if pos is beyond the 32-bit offset limit that it should return an error, but if it is not beyond this limit it must return zero.
Created attachment 5016 [details] a program that demonstrates the bug
Would you kindly explain why you have closed this as not a bug? Did it get fixed in a future release? Is there a superceding standard which does not require the behavior as I quoted from Single Unix Spec v2?
Sorry I meant to close it as 'WONTFIX' - I missed the button. In the 2.2 tree it is WONTFIX as we won't be making non critical changes to the 2.2 tree. In Linux 2.4 we seem to pass the test suite and inspection of the code agrees the problem is gone. As regards standards SuS V3 replaces V2 but I don't believe it changed anything