OSDN Git Service

Fix <sys/resource.h>.
authorElliott Hughes <enh@google.com>
Thu, 9 Jan 2014 18:17:03 +0000 (10:17 -0800)
committerElliott Hughes <enh@google.com>
Thu, 9 Jan 2014 19:00:04 +0000 (11:00 -0800)
commit0f461e35f63200641fc53bba222845a84589c024
treed5b0d3a9e13f4699bdc57dfd422a69ddfdde5090
parent8276d2875f64587e266567f5bb2c5e0c70ef0a5d
Fix <sys/resource.h>.

The situation here is a bit confusing. On 64-bit, rlimit and rlimit64 are
the same, and so getrlimit/getrlimit64, setrlimit/setrlimit64,
and prlimit/prlimit64 are all the same. On 32-bit, rlimit and rlimit64 are
different. 32-bit architectures other than MIPS go one step further by having
an even more limited getrlimit system call, so arm and x86 need to use
ugetrlimit instead of getrlimit. Worse, the 32-bit architectures don't have
64-bit getrlimit- and setrlimit-equivalent system calls, and you have to use
prlimit64 instead. There's no 32-bit prlimit system call, so there's no
easy implementation of that --- what should we do if the result of prlimit64
won't fit in a struct rlimit? Since 32-bit survived without prlimit/prlimit64
for this long, I'm not going to bother implementing prlimit for 32-bit.

We need the rlimit64 functions to be able to build strace 4.8 out of the box.

Change-Id: I1903d913b23016a2fc3b9f452885ac730d71e001
19 files changed:
libc/SYSCALLS.TXT
libc/arch-aarch64/syscalls.mk
libc/arch-aarch64/syscalls/getrlimit.S
libc/arch-aarch64/syscalls/prlimit64.S [new file with mode: 0644]
libc/arch-aarch64/syscalls/setrlimit.S
libc/arch-arm/syscalls.mk
libc/arch-arm/syscalls/prlimit64.S [new file with mode: 0644]
libc/arch-mips/syscalls.mk
libc/arch-mips/syscalls/prlimit64.S [new file with mode: 0644]
libc/arch-x86/syscalls.mk
libc/arch-x86/syscalls/prlimit64.S [new file with mode: 0644]
libc/arch-x86_64/syscalls.mk
libc/arch-x86_64/syscalls/getrlimit.S
libc/arch-x86_64/syscalls/prlimit64.S [new file with mode: 0644]
libc/arch-x86_64/syscalls/setrlimit.S
libc/bionic/legacy_32_bit_support.cpp
libc/include/sys/resource.h
tests/Android.mk
tests/sys_resource_test.cpp [new file with mode: 0644]