- struct uthread_info th_info;
- int ret = do_lunaix_syscall(__SYSCALL_th_create, thread, &th_info, __pthread_routine_wrapper, NULL);
-
- if (ret) {
- return ret;
- }
-
- // FIXME we should encapsulate these parameter into struct
- // and pass it as a single thread param.
-
- void** th_stack = (void**) th_info.th_stack_top;
- th_stack[1] = (void*)start_routine;
- th_stack[2] = arg;