Skip to content
Commit 9ff0a447 authored by Mikhail R. Gadelha's avatar Mikhail R. Gadelha
Browse files

[libc] Fix setrlimit/getrlimit on 32-bit systems

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 changes rlim_t to be __UINT64_TYPE__ (which also changes
rlimit as a side-effect), fixing the problem of mismatching types in
the syscall.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159104
parent 063524e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment