From 695d7d138eda449678a1650a8b8b58181033353f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 9 May 2017 14:05:09 +0000 Subject: Assume prlimit64 is available. This patch makes sysdeps/unix/sysv/linux code assume the prlimit64 syscall is always available, given the minimum of a 3.2 kernel. __ASSUME_PRLIMIT64, which in fact was no longer used, is removed. Code conditional on __NR_prlimit64 being defined is made unconditional. Fallback code for the case where prlimit64 produces an ENOSYS error is removed, substantially simplifying some functions. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRLIMIT64): Remove macro. * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/prlimit.c [__NR_prlimit64]: Make code unconditional. [!__NR_prlimit64]: Remove conditional code. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit64): Likewise. --- sysdeps/unix/sysv/linux/prlimit.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'sysdeps/unix/sysv/linux/prlimit.c') diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c index 2996e73..d31980f 100644 --- a/sysdeps/unix/sysv/linux/prlimit.c +++ b/sysdeps/unix/sysv/linux/prlimit.c @@ -20,7 +20,6 @@ #include -#ifdef __NR_prlimit64 int prlimit (__pid_t pid, enum __rlimit_resource resource, const struct rlimit *new_rlimit, struct rlimit *old_rlimit) @@ -73,12 +72,3 @@ prlimit (__pid_t pid, enum __rlimit_resource resource, return res; } -#else -int -prlimit (__pid_t pid, enum __rlimit_resource resource, - const struct rlimit *new_rlimit, struct rlimit *old_rlimit) -{ - return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS); -} -stub_warning (prlimit) -#endif -- cgit v1.1