]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
bump RLIMIT_AS if restricted
authorJan Beulich <jbeulich@novell.com>
Tue, 11 Jan 2011 18:38:59 +0000 (18:38 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 11 Jan 2011 18:39:50 +0000 (18:39 +0000)
Mostly the same as is already being done for several other RLIMIT_*
values.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
vl.c

diff --git a/vl.c b/vl.c
index d465a09cf6ee63dfc2c388e3fe7dea634d329ced..2ee9aeee610f3cd00c242d49506ea80017af277b 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4846,6 +4846,13 @@ int main(int argc, char **argv, char **envp)
     rl.rlim_cur = rl.rlim_max;
     if (setrlimit(RLIMIT_DATA, &rl) != 0)
        perror("setrlimit(RLIMIT_DATA)");
+    if (getrlimit(RLIMIT_AS, &rl) == 0) {
+       rl.rlim_cur = rl.rlim_max;
+       if (setrlimit(RLIMIT_AS, &rl) != 0)
+          perror("setrlimit(RLIMIT_AS)");
+    } else {
+       perror("getrlimit(RLIMIT_AS)");
+    }
     rl.rlim_cur = RLIM_INFINITY;
     rl.rlim_max = RLIM_INFINITY;
     if (setrlimit(RLIMIT_RSS, &rl) != 0)