This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: st_blocks incorrect for files larger than 2Gbytes



>   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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]