X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Frunas.c;h=86db9b8682c343efaee59a08bee72123fc518d60;hb=67cf0ab7b6d900a208d5d5ec6b348422527b1971;hp=cc503412689f55f48524ef515d608a9f1a4cdf4b;hpb=10a8a2237343699e3923d87e24dbf2d7fe225377;p=lttng-tools.git diff --git a/src/common/runas.c b/src/common/runas.c index cc5034126..86db9b868 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -28,14 +28,20 @@ #include #include #include -#include +#include -#include +#include +#include +#include #include "runas.h" #define RUNAS_CHILD_STACK_SIZE 10485760 +#ifndef MAP_STACK +#define MAP_STACK 0 +#endif + struct run_as_data { int (*cmd)(void *data); void *data; @@ -231,9 +237,8 @@ int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid) * Pointing to the middle of the stack to support architectures * where the stack grows up (HPPA). */ - pid = clone(child_run_as, child_stack + (RUNAS_CHILD_STACK_SIZE / 2), - CLONE_FILES | SIGCHLD, - &run_as_data, NULL); + pid = lttng_clone_files(child_run_as, child_stack + (RUNAS_CHILD_STACK_SIZE / 2), + &run_as_data); if (pid < 0) { perror("clone"); ret = pid;