runas: use CLONE_VM flag
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 7 Jan 2012 19:56:55 +0000 (14:56 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 7 Jan 2012 19:56:55 +0000 (14:56 -0500)
Having to clone the vma each time runas is executed brings a significant
slowdown to the "start" operation when done with attached application,
and to the file creation needed when an application is attaching to the
sessiond. Use CLONE_VM flag to speed this up.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
librunas/runas.c

index b3fa81469824ecc6b69979e6a64e408cbd4a5546..f612ccc7554590a44fdeca167a33f29d4b0ee0d0 100644 (file)
@@ -230,7 +230,7 @@ int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid)
         * where the stack grows up (HPPA).
         */
        pid = clone(child_run_as, child_stack + (CHILD_STACK_SIZE / 2),
-               CLONE_FILES | SIGCHLD,
+               CLONE_FILES | SIGCHLD | CLONE_VM,
                &run_as_data, NULL);
        if (pid < 0) {
                perror("clone");
This page took 0.026836 seconds and 5 git commands to generate.