After a clone system call there are two threads of control running so we

need to make sure the child exits or we will get two copies of the output
from each test which follows. Also some older systems do not define the
CLONE_PARENT_SETTID flag.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3007
This commit is contained in:
Tom Hughes 2004-11-15 15:35:49 +00:00
parent a01f2960be
commit de135bbb7f

View File

@ -507,9 +507,15 @@ int main(void)
// __NR_clone 120
#include <sched.h>
#include <signal.h>
#ifndef CLONE_PARENT_SETTID
#define CLONE_PARENT_SETTID 0x00100000
#endif
// XXX: should really be "4s 2m"? Not sure... (see PRE(sys_clone))
GO(__NR_clone, "4s 0m");
SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0);
if (SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0) == 0)
{
SY(__NR_exit, 0);
}
// __NR_setdomainname 121
GO(__NR_setdomainname, "n/a");