[RFC v1 05/16] sysdeps/getrlimit: Use __NR_prlimit64 if avaliable
Alistair Francis
alistair.francis@wdc.com
Sat Jun 22 04:47:00 GMT 2019
If the __NR_prlimit64 syscall is avaliable let's use that instead of
__NR_ugetrlimit as it isn't always avaliable (they aren't avaliable
on RV32).
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
ChangeLog | 1 +
sysdeps/unix/sysv/linux/getrlimit.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 9ed9bea8b1..1f1070ebc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* sysdeps/unix/sysv/linux/wait.c: Use __NR_waitid if avaliable.
* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
* sysdeps/unix/sysv/linux/waitpid_nocancel.c: Likewise.
+ * sysdeps/unix/sysv/linux/getrlimit.c: Use __NR_prlimit64 if avaliable
2019-06-20 Dmitry V. Levin <ldv@altlinux.org>
Florian Weimer <fweimer@redhat.com>
diff --git a/sysdeps/unix/sysv/linux/getrlimit.c b/sysdeps/unix/sysv/linux/getrlimit.c
index 10c0176619..2917029afd 100644
--- a/sysdeps/unix/sysv/linux/getrlimit.c
+++ b/sysdeps/unix/sysv/linux/getrlimit.c
@@ -35,7 +35,11 @@
int
__new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlim)
{
+#ifdef __NR_prlimit64
+ return INLINE_SYSCALL_CALL (prlimit64, 0, resource, rlim, NULL);
+#else
return INLINE_SYSCALL_CALL (ugetrlimit, resource, rlim);
+#endif
}
weak_alias (__new_getrlimit, __getrlimit)
hidden_weak (__getrlimit)
--
2.22.0
More information about the Libc-alpha
mailing list