Re: clone testcases in LTP

From: Peter Chubb <peter_at_chubb.wattle.id.au>
Date: 2003-07-11 10:04:43
>>>>> "David" == David Mosberger <davidm@napali.hpl.hp.com> writes:

>>>>> On Fri, 11 Jul 2003 09:22:42 +1000, Peter Chubb <peter@chubb.wattle.id.au> said:
Peter> I'm not finding that clone2() works -- We get a segfault in the
Peter> cloned process when it returns.

Peter> __clone2(func, stack, STACKSIZE, SIGCHLD, NULL, NULL, NULL,
Peter> NULL))

David> Umh, you're creating a new process with a different initial
David> function.  I doubt this has ever been tested.  It probably
David> should work, but I don't know of any app doing this for real
David> (either you fork, or you create a thread).

The library __clone2() call should cope with this.
It does, essentially,

   switch(kidpid = sys_clone2(flags, stackbase, stacksize, ptidp, tlsp, tidp)) {
   case -1:
	goto __syscall_error;
   case 0:
	exit(fn(arg));
   default:
	return kidpid;
   }

Peter C
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Jul 10 20:07:00 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:16 EST