Index: qemu-arm-eabi/linux-user/syscall.c =================================================================== --- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-13 19:10:54.000000000 -0300 +++ qemu-arm-eabi/linux-user/syscall.c 2008-10-13 19:31:01.000000000 -0300 @@ -3177,6 +3177,7 @@ pthread_cond_t cond; pthread_t thread; uint32_t tid; + unsigned int flags; abi_ulong child_tidptr; abi_ulong parent_tidptr; sigset_t sigmask; @@ -3190,9 +3191,11 @@ env = info->env; thread_env = env; info->tid = gettid(); - if (info->child_tidptr) + if (info->flags & CLONE_CHILD_SETTID) put_user_u32(info->tid, info->child_tidptr); - if (info->parent_tidptr) + if (info->flags & CLONE_CHILD_CLEARTID) + set_tid_address(g2h(info->child_tidptr)); + if (info->flags & CLONE_PARENT_SETTID) put_user_u32(info->tid, info->parent_tidptr); /* Enable signals. */ sigprocmask(SIG_SETMASK, &info->sigmask, NULL); @@ -3257,7 +3260,6 @@ nptl_flags = flags; flags &= ~CLONE_NPTL_FLAGS2; - /* TODO: Implement CLONE_CHILD_CLEARTID. */ if (nptl_flags & CLONE_SETTLS) cpu_set_tls (new_env, newtls); @@ -3269,7 +3271,9 @@ pthread_mutex_lock(&info.mutex); pthread_cond_init(&info.cond, NULL); info.env = new_env; - if (nptl_flags & CLONE_CHILD_SETTID) + info.flags = nptl_flags; + if (nptl_flags & CLONE_CHILD_SETTID || + nptl_flags & CLONE_CHILD_CLEARTID) info.child_tidptr = child_tidptr; if (nptl_flags & CLONE_PARENT_SETTID) info.parent_tidptr = parent_tidptr; @@ -3332,7 +3336,8 @@ ts = (TaskState *)env->opaque; if (flags & CLONE_SETTLS) cpu_set_tls (env, newtls); - /* TODO: Implement CLONE_CHILD_CLEARTID. */ + if (flags & CLONE_CHILD_CLEARTID) + set_tid_address(g2h(child_tidptr)); } else { fork_end(0); }