Dear all,
I am using patch uml-2.6.12-rc4-bb-20050521-18:54.patch.bz2 on kernel 2.6.12-rc4.
but found pthread_create() cannot work.
it seems, in copy_thread() in arch/um/kernel/process_kern.c, the ret value's setting is not correct
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
  unsigned long stack_top, struct task_struct * p,
  struct pt_regs *regs)
 int ret;
 p->thread = (struct thread_struct) INIT_THREAD;
 ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
    clone_flags, sp, stack_top, p, regs);
 if (ret || !current->thread.forking)
  goto out;
 if (UPT_ESI(&current->thread.regs.regs) != UPT_ESI(&p->thread.regs.regs))
  printk(KERN_DEBUG "newtls_new %x,old %x\n", (unsigned int) UPT_ESI(&current->thread.regs.regs),
    (unsigned int) UPT_ESI(&p->thread.regs.regs));
  * Set a new TLS for the child thread?
 if (clone_flags & CLONE_SETTLS) {
  struct user_desc info;
  int idx;
  ret = -EFAULT;
  if (copy_from_user(&info, (void __user *)UPT_ESI(&current->thread.regs.regs), sizeof(info)))
   goto out;
  ret = -EINVAL;
  if (LDT_empty(&info))
   goto out;
  idx = info.entry_number;
  set_tls_entry(p, &info, idx, 0);
 return ret;
I add a "ret=0;" after set_tls_entry(p, &info, idx, 0);
after it, pthread_create() can return correctly, but the new thread cannot be scheduled correctly.
there is always a "Segment Fault".
I am using libc 2.3.3 and libc 2.3.4.
on 2.3.2, no "Segment Fault", it looks good.
Has anyone had a test of NPTL on UML?