This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
Re: st_blocks incorrect for files larger than 2Gbytes
- To: deo at logos-m dot ru
- Subject: Re: st_blocks incorrect for files larger than 2Gbytes
- From: DJ Delorie <dj at delorie dot com>
- Date: Wed, 26 Jul 2000 09:44:15 -0400
- CC: cygwin-developers at sourceware dot cygnus dot com
- References: <10678.000726@logos-m.ru>
> buf->st_blocks = (buf->st_size + S_BLKSIZE-1) / S_BLKSIZE;
>
> which way is preferable?
Casting buf->st_size to (unsigned long) before doing the math is.
off_t is signed, but negative sizes are meaningless.
However, this topic belongs on the newlib list, not the cygwin list.