Go to the previous, next section.
int ptrace(int request, int pid, int
addr, int data);
request: [in] the kind of request.
pid: [in] target task.
addr: [in] the address where to perform peek and poke operations.
data: [in] the data to write for poke operations and [out] the data read for peek operations.
This call is used for debugging a child of the current task. The traced child
will run until a signal occurs. The parent is notified through the
wait syscall. When the child is stoped the content of its address
space may be read and written by the parent. The request parameter
may be one of the following:
PTRACE_TRACEME
PTRACE_PEEKTEXT, PTRACE_PEEKDATA
PTRACE_PEEKUSR
PTRACE_POKETEXT, PTRACE_POKEDATA
PTRACE_POKEUSR
PTRACE_SYSCALL, PTRACE_CONT
PTRACE_KILL
SIGKILL to the child.
PTRACE_SINGLESTEP
PTRACE_ATTACH
PTRACE_DETACH
On success zero is returned. On error -1 is returned and errno
is set to one of the following values:
EPERM: the target taks cannot be traced or is already being
traced.
ESRCH, EIO.