question about hsc2hs

Ross Paterson ross at soi.city.ac.uk
Tue Feb 2 11:13:19 EST 2010


On Tue, Feb 02, 2010 at 03:51:18PM +0100, Jose A. Ortega Ruiz wrote:
> [...] The problem is that the size and
> some of the offsets of the C struct statfs computed by hsc2c are wrong:
> i'm in a 32bit linux system, and i've checked, using a C program, that
> sizeof(struct statfs) is 64 (hsc2 is giving 84 -- although perhaps
> Haskell needs additional space for housekeeping?), and that the offsets
> of f_bfree and f_bavail are, respectively, 12 and 16 (not 16 and 24).
> Also, i know that 12 and 16 are the right values because putting them by
> hand gives me the correct statfs values.

If you compile your C program with -D_FILE_OFFSET_BITS=64 you'll get the
same numbers that hsc2hs does.


More information about the Glasgow-haskell-users mailing list