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
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index d0fa528..6e10daa 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -62,12 +62,21 @@
 int     tgkill(pid_t tgid, pid_t tid, int sig)  all
 int     __ptrace:ptrace(int request, int pid, void* addr, void* data)  all
 int     __set_thread_area:set_thread_area(void*  user_desc)  mips,x86
-int     __getpriority:getpriority(int, int)  all
-int     setpriority(int, int, int)   all
-int     setrlimit(int resource, const struct rlimit* rlp)  all
-int     getrlimit:ugetrlimit(int resource, struct rlimit* rlp)  arm,x86
-int     getrlimit:getrlimit(int resource, struct rlimit* rlp)  aarch64,mips,x86_64
-int     getrusage(int who, struct rusage*  r_usage)  all
+
+# <sys/resource.h>
+int getrusage(int, struct rusage*)  all
+int __getpriority:getpriority(int, int)  all
+int setpriority(int, int, int)   all
+# On LP64, rlimit and rlimit64 are the same.
+# On 32-bit systems we use prlimit64 to implement the rlimit64 functions.
+int getrlimit:ugetrlimit(int, struct rlimit*)  arm,x86
+int getrlimit(int, struct rlimit*)  mips
+int getrlimit|getrlimit64(int, struct rlimit*)  aarch64,x86_64
+int setrlimit(int, const struct rlimit*)  arm,mips,x86
+int setrlimit|setrlimit64(int, const struct rlimit*)  aarch64,x86_64
+int prlimit64|prlimit(pid_t, int, struct rlimit64*, const struct rlimit64*)  aarch64,x86_64
+int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*)  arm,mips,x86
+
 int     setgroups:setgroups32(int, const gid_t*)   arm,x86
 int     setgroups:setgroups(int, const gid_t*)     aarch64,mips,x86_64
 int     setpgid(pid_t, pid_t)  all