* stack sizes: 8MB.
*/
#define __LXCFS_STACK_SIZE (8 * 1024 * 1024)
-static pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
+pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
{
pid_t ret;
void *stack;
return sigaction(signo, &action, NULL);
}
+extern pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags);
+
#endif /* __LXCFS_BINDINGS_H */
.tpid = tpid,
.wrapped = &pid_to_ns
};
- size_t stack_size = sysconf(_SC_PAGESIZE);
- void *stack = alloca(stack_size);
- cpid = clone(pid_ns_clone_wrapper, stack + stack_size, SIGCHLD, &args);
+ cpid = lxcfs_clone(pid_ns_clone_wrapper, &args, 0);
if (cpid < 0)
_exit(1);
.tpid = tpid,
.wrapped = &pid_from_ns
};
- size_t stack_size = sysconf(_SC_PAGESIZE);
- void *stack = alloca(stack_size);
- cpid = clone(pid_ns_clone_wrapper, stack + stack_size, SIGCHLD, &args);
+ cpid = lxcfs_clone(pid_ns_clone_wrapper, &args, 0);
if (cpid < 0)
_exit(1);