libc uses SYS_prlimit64 (which takes a struct rlimit64) to implement
setrlimt and getrlimit (which take a struct rlimit). In 64-bit bits
systems this is not an issue since the members of struct rlimit64 and
struct rlimit are 64 bits long, however, in 32-bit systems the members
of struct rlimit are only 32 bits long, causing wrong values being
passed to SYS_prlimit64.
This patch adds new struct rlimit64 (and rlim64_t) to fix this issue.
We now create a local struct rlimit64 variable in setrlimt/getrlimit,
pass it to SYS_prlimit64 (and rewrite the original rlimit struct in
getrlimit if the syscall succeeds).