[KinoSearch] KinoSearch Death

Marvin Humphrey marvin at rectangular.com
Fri Oct 20 05:18:36 PDT 2006


On Oct 20, 2006, at 4:55 AM, Aaron Crane wrote:

> Marvin Humphrey writes:
>> When PerlIO_read fails, it's supposed to set errno to a positive
>> number indicating the type of error that occurred -- just like the
>> stdio function fread().  Here's a snippet from its documentation in
>> perlapio:
>>
>>     Returns a byte count if successful (which may be zero or  
>> positive),
>>     returns negative value and sets errno on error.
>>
>> So, it looks like we've tickled a bug in PerlIO_read.  It thinks it
>> succeeded by giving us 0 bytes, even though we asked for 1024.
>
> I strongly suspect that's not a bug in PerlIO_read.  If PerlIO_read()
> really is like stdio fread() (or POSIX read(), for that matter), it's
> designed to treat a short read as success.  That is, the read  
> returns as
> many bytes as you asked for, or as many as were available,  
> whichever is
> less.  In particular, if you attempt to read from a file when there  
> are
> no more bytes of the file left to read, that gives you a successful  
> read
> of 0 bytes -- an EOF condition.

Mmmf, yeah, good catch, you're right.  I wonder how that squares with  
the NFS sync hypothesis.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/





More information about the kinosearch mailing list