[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lseek to end on partition raw device returns 0
On Wed, 15 Dec 2010, Toby Karyadi wrote:
> Does anyone know why doing lseek(fd, 0, SEEK_END), where fd is a
> descriptor to a raw disk partition, always returns 0 on current?
That seems like a bug. If lseek is unable to do what you asked (seek
to the end of the file, and report the resulting offset relative to the
beginning of the file), then it should return -1 and set errno. Of
course I'd prefer to get the correct result, but failing that an error
would be acceptable; an incorrect result seems to me to be unacceptable.
--apb (Alan Barrett)
Main Index |
Thread Index |