2 * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
8 #include <asm/unistd.h>
10 #include <as-layout.h>
11 #include <ptrace_user.h>
12 #include <stub-data.h>
13 #include <sysdep/stub.h>
16 * This is in a separate file because it needs to be compiled with any
17 * extraneous gcc flags (-pg, -fprofile-arcs, -ftest-coverage) disabled
19 * Use UM_KERN_PAGE_SIZE instead of PAGE_SIZE because that calls getpagesize
23 void __attribute__ ((__section__ (".__syscall_stub")))
24 stub_clone_handler(void)
26 struct stub_data
*data
= (struct stub_data
*) STUB_DATA
;
29 err
= stub_syscall2(__NR_clone
, CLONE_PARENT
| CLONE_FILES
| SIGCHLD
,
30 STUB_DATA
+ UM_KERN_PAGE_SIZE
/ 2 - sizeof(void *));
34 err
= stub_syscall4(__NR_ptrace
, PTRACE_TRACEME
, 0, 0, 0);
38 err
= stub_syscall3(__NR_setitimer
, ITIMER_VIRTUAL
,
39 (long) &data
->timer
, 0);
43 remap_stack(data
->fd
, data
->offset
);
48 * save current result.
50 * child: retcode of mmap already saved and it jumps around this