st_blocks incorrect for files larger than 2Gbytes

Chris Faylor cgf@cygnus.com
Wed Jul 26 10:58:00 GMT 2000


On Wed, Jul 26, 2000 at 01:50:17PM -0400, Chris Faylor wrote:
>On Wed, Jul 26, 2000 at 06:56:07PM +0400, Egor Duda wrote:
>>Wednesday, 26 July, 2000 DJ Delorie dj@delorie.com wrote:
>>
>>>>   buf->st_blocks = (buf->st_size + S_BLKSIZE-1) / S_BLKSIZE;
>>>>
>>>> which way is preferable?
>>
>>DD>Casting  buf->st_size  to (unsigned long) before doing the math is.
>>DD>off_t is signed, but negative sizes are meaningless.
>>
>>Wed Jul 26 14:32:38 2000  Egor Duda <deo@logos-m.ru>
>>
>>        * syscalls.cc: Make stat return correct st_blocks for files
>>          with size bigger than 2Gb and less than 4Gb

Btw, I applied this patch.

cgf


More information about the Cygwin-patches mailing list