[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sat, 09 Oct 2010 20:40:26 +0200
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:18.104.22.168) Gecko/20100918 Icedove/3.0.8
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". But the Hurd pread()
ignores the offset parameter.
The reason is quite simple: pread() passes the offset parameter to
io_read(), which is supposed to ignore it when the object is not
seekable. So pread() can't know that the offset was ignored and behaves
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.
: According to the Hurd Reference Manual and to <hurd/io.defs>.
Description: OpenPGP digital signature