PIXIL development - now?

Malcolm malcolm.parsons at gmail.com
Mon Sep 24 22:40:22 CEST 2007


On 24/09/2007, Troy Davis <gpf at dslinux.in-berlin.de> wrote:
> According to the libpthread library readme it uses clone(), not vfork().
>
> from the readme
> "LinuxThreads provides kernel-level threads: each thread is a separate
> Unix process, sharing its address space with the other threads through
> the new system call clone(). Scheduling between threads is handled by
> the kernel scheduler, just like scheduling between Unix processes."

clone is a superset of fork() and vfork():

asmlinkage int sys_fork(struct pt_regs *regs)
{
	return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
}

asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
			 int __user *parent_tidptr, int tls_val,
			 int __user *child_tidptr, struct pt_regs *regs)
{
	if (!newsp)
		newsp = regs->ARM_sp;

	return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
}

asmlinkage int sys_vfork(struct pt_regs *regs)
{
	return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs,
0, NULL, NULL);
}

-- 
Malcolm Parsons



More information about the dslinux-devel mailing list