summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2025-08-15 02:57:30 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-09-22 00:52:37 +0200
commit802b0eba519b1333c639fd0e1b55222099df9263 (patch)
tree54edcd609848cf84ddb4672d669b9a76ad3693cb /hurd
parentc9cc047e9f222b20fa3704d67d46b39e3456119b (diff)
hurd: implement RLIMIT_AS against Mach RPCs
Check for VM limit RPCs * config.h.in: add #undef for HAVE_MACH_VM_GET_SIZE_LIMIT and HAVE_MACH_VM_SET_SIZE_LIMIT. * sysdeps/mach/configure.ac: use mach_RPC_CHECK to check for vm_set_size_limit and vm_get_size_limit RPCs in gnumach.defs. * sysdeps/mach/configure: regenerate file. Use vm_get_size_limit to initialize RLIMIT_AS * hurd/hurdrlimit.c(init_rlimit): use vm_get_size_limit to initialize RLIMIT_AS entry of the _hurd_rlimits array. Notify the kernel of the new VM size limits * sysdeps/mach/hurd/setrlimit.c: use the vm_set_size_limit RPC, if available, to notify the kernel of the new limits. Retry RPC calls if they were interrupted by a signal. Message-ID: <03fb90a795b354a366ee73f56f73e6ad22a86cda.1755220108.git.dnietoc@gmail.com>
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdrlimit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hurd/hurdrlimit.c b/hurd/hurdrlimit.c
index 6cb5045bfe..271117b1e0 100644
--- a/hurd/hurdrlimit.c
+++ b/hurd/hurdrlimit.c
@@ -37,6 +37,11 @@ init_rlimit (void)
__mutex_init (&_hurd_rlimit_lock);
+#ifdef HAVE_MACH_VM_GET_SIZE_LIMIT
+ __vm_get_size_limit (__mach_task_self (),
+ &_hurd_rlimits[RLIMIT_AS].rlim_cur, &_hurd_rlimits[RLIMIT_AS].rlim_max);
+#endif
+
for (i = 0; i < RLIM_NLIMITS; ++i)
{
if (_hurd_rlimits[i].rlim_max == 0)