Hello, It seems the Hurd implementation of pread() is not POSIX-compliant. POSIX stipulates that "An attempt to perform a pread() on a file that is incapable of seeking shall result in an error"[0]. But the Hurd pread() ignores the offset parameter.
The reason is quite simple: pread() passes the offset parameter to io_read(), which is supposed[1] to ignore it when the object is not seekable. So pread() can't know that the offset was ignored and behaves incorrectly. There should be a way to check if the object is seekable or not before calling io_read(), so pread() can return an error. But there is no io_seekable() RPC, and calling io_seek() seems wrong to me, since pread() is supposed not to change the file offset. Any idea? [0]: http://www.opengroup.org/onlinepubs/009695399/functions/read.html [1]: According to the Hurd Reference Manual and to <hurd/io.defs>. -- Manuel Menal
signature.asc
Description: OpenPGP digital signature