On Wed, 1 Dec 1999, John Trudeau wrote:

> The stat() call is returning a correct size.
> 
> The read() call is sensitive to how much space is available in the =
> *destination* buffer.  Even though there is no data to
> read.  Expanding the *destination* buffer allows the read()
> to properly return 0.

Your test results show that the amount of slack is much less than the
factor of 2 you were suggesting.  Moreover, the results seem to be
unpredictable: sometimes zero padding works, sometimes doesn't.
Compare this:

> PAD  0, st_size 2864, bufsize 2864, count 2766, status = -1

with this:

> PAD  0, st_size 2864, bufsize 2864, count 2766, status =  0

Why were the results different for the same file with the same (zero)
amount of slack?

Is it possible to ask Cygwin people to try to shed some light on this
mystery?  I guess it's no big deal to ask malloc for twice as much
storage, if it makes Cygwin happy, but without a clear understanding
of the cause, how can we ever be sure it does indeed solve the
problem, especially since the results don't seem to be repeatable?

I mean, software *is* an art to some extent, but not a _black_ art ;-).

Reply via email to