Ticket #5504 (closed bug: duplicate)
Inconsistent sizes for struct rlimit
On my 32-bit system, I find
/* Define to Haskell type for rlim_t */ #define HTYPE_RLIM_T Word64
in HsBaseConfig.h. gcc says sizeof(rlim_t) = 4 and thus sizeof(struct rlimit) = 8.
Previously (7.0 and before), get/setResourceLimit allocated a 16-byte buffer and wrote/read the hard limit at an 8-byte offset, consistent with HsBaseConfig.h (but not with sys/resource.h), and apparently it worked (test resourceLimit used to pass and getting the limits returned the previously set values in a few tests for various resources).
Now they allocate 8 bytes and read/write the hard limit at a 4-byte offset, consistent with sys/resource.h, but inconsistent with HsBaseConfig.h, and resourceLimit fails, the same tests as above always returned ResourceLimit (2^64-1) for both, soft and hard limits. (The compiled ways of resourceLimit fail with invalid argument on setting.)