#348: Chicken should use proper C types for struct stat members
--------------------+-------------------------------------------------------
Reporter: sjamaan | Owner: felix
Type: defect | Status: new
Priority: major | Component: core libraries
Version: 2.7 | Keywords: typing, C interface, posix
--------------------+-------------------------------------------------------
See the thread "[http://lists.gnu.org/archive/html/chicken-hackers/2007-
10/msg00017.html file-size not reporting correct size on big files]" on
chicken-hackers.
The problem is that chicken uses {{{unsigned-int}}} as the type of
{{{stat}}} structure members (and probably in other places, too!), which
causes problems on 32-bit architectures. The {{{stat.st_size}}} is of
type {{{off_t}}}, which ''can'' be 64-bit on some systems, if compiled the
right way. When using an {{{unsigned-int}}}, huge file sizes (bigger than
1Gb) overflow/get truncated. Simply using an int64 is not the solution
either, as you don't know what size {{{off_t}}} is actually. If it ''is''
32-bits you would be getting file sizes that are corrupted even more.