Commit 92c64f7e by Daniel Lezcano

Fix ia64 clone

Fix the stack address for ia64. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent d8f8e352
...@@ -67,14 +67,14 @@ pid_t lxc_clone(int (*fn)(void *), void *arg, int flags) ...@@ -67,14 +67,14 @@ pid_t lxc_clone(int (*fn)(void *), void *arg, int flags)
}; };
long stack_size = sysconf(_SC_PAGESIZE); long stack_size = sysconf(_SC_PAGESIZE);
void *stack = alloca(stack_size) + stack_size; void *stack = alloca(stack_size);
pid_t ret; pid_t ret;
#ifdef __ia64__ #ifdef __ia64__
ret = __clone2(do_clone, stack, ret = __clone2(do_clone, stack,
stack_size, flags | SIGCHLD, &clone_arg); stack_size, flags | SIGCHLD, &clone_arg);
#else #else
ret = clone(do_clone, stack, flags | SIGCHLD, &clone_arg); ret = clone(do_clone, stack + stack_size, flags | SIGCHLD, &clone_arg);
#endif #endif
if (ret < 0) if (ret < 0)
ERROR("failed to clone(0x%x): %s", flags, strerror(errno)); ERROR("failed to clone(0x%x): %s", flags, strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment