contain.o: contain.h common.h cgroup.h log.h mount.h net.h pid.h util.h uts.h
log.o: log.h common.h
cgroup.o: cgroup.h common.h log.h util.h
-mount.o: mount.h common.h log.h util.h
+mount.o: mount.h common.h log.h subproc.h util.h
net.o: net.h common.h log.h subproc.h
pid.o: pid.h common.h log.h subproc.h
sandbox.o: sandbox.h common.h log.h
}
static uint8_t subprocCloneStack[PTHREAD_STACK_MIN * 2];
+static __thread jmp_buf env;
-static int subprocCloneFunc(void *arg)
+static int subprocCloneFunc(void *arg __attribute__ ((unused)))
{
- jmp_buf *env_ptr = (jmp_buf *) arg;
- longjmp(*env_ptr, 1);
+ longjmp(env, 1);
+ return 0;
}
/*
return -1;
}
- jmp_buf env;
if (setjmp(env) == 0) {
/*
* Avoid the problem of the stack growing up/down under different CPU architectures, by using
*/
void *stack = &subprocCloneStack[sizeof(subprocCloneStack) / 2];
/* Parent */
- return clone(subprocCloneFunc, stack, flags, &env, NULL, NULL);
+ return clone(subprocCloneFunc, stack, flags, NULL, NULL, NULL);
}
/* Child */
return 0;