#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
-#include <sys/mman.h>
+#include <sys/signal.h>
#include <common/error.h>
+#include <common/compat/mman.h>
+#include <common/compat/clone.h>
#include "runas.h"
* 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;