From 10d32e930a6b67c3f196ca3bf4f247d444d8c2b6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 7 Jan 2012 14:56:55 -0500 Subject: [PATCH] runas: use CLONE_VM flag 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 --- librunas/runas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librunas/runas.c b/librunas/runas.c index b3fa81469..f612ccc75 100644 --- a/librunas/runas.c +++ b/librunas/runas.c @@ -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"); -- 2.34.1