This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v1 05/16] sysdeps/getrlimit: Use __NR_prlimit64 if avaliable
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: alistair dot francis at wdc dot com, alistair23 at gmail dot com
- Date: Fri, 21 Jun 2019 21:37:25 -0700
- Subject: [RFC v1 05/16] sysdeps/getrlimit: Use __NR_prlimit64 if avaliable
- Ironport-sdr: gR2SwYqcpsDJ2iWcfqx8DP8Ek/g9cmPOvVHLimmw2lnTw/WOuE6lCcAzvGa56JzuPCy5pJoTjU K7VEPlscFtuddLyg9+1QMgaFmt9xiLgG5osoZWDia6VTVRqyWzZdhfXz7dZFO5ApQjYok4bawA mOcdz4U/CDUqpOD4Co0tVdrvnUwKoJrIUVlMceM+Qn6zX72MynVBtYLfI9CCbxYpQhVtGb4QFN HxbYrxckgQkpNZnvxPcRygpfx1/QBHTYX1M3yIEPGuThYRxruqaqA+VH3o/DxrZT/cn/0l00M2 cGSQjgcNGBmTEJGP6eF/RV5j
- Ironport-sdr: IGaQHACuRbIrCzWYehkyD+gOEY3JZ2r2e7sbGUvEvysKSmasDQ1f228vDo9A3VxukgPJkZGawq VBrQ73lpKKlH9vuG2tgScAUc0h2isQJOvPh50LtW20Yu0u81jNBkXsQC1qVAFq9+Bz9Wn0oGKo JbkIW6LFXcetV/2h9S3e6r1cRHqPqRZZKR6L+5DbxjZU+xDozGDZi60qcC58Lg2jGSZrXaQR65 zhEUkymR5pX0Z6nlpwVRZmvocBbx7FFxo1Wk5x8qh2akqUkG7GQOe/vB6fORwiKjh4L9u1AXZU EEs=
- References: <cover.1561177967.git.alistair.francis@wdc.com>
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