#5504: Inconsistent sizes for struct rlimit
----------------------------------+-----------------------------------------
Reporter: daniel.is.fischer | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/unix
Version: 7.3 | Keywords:
Testcase: | Blockedby:
Os: Linux | Blocking:
Architecture: x86 | Failure: None/Unknown
----------------------------------+-----------------------------------------
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.)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5504>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs