ptrace requests
The ptrace system call has a libc wrapper like any other system call, so you may include ptrace.h and simply call ptrace while passing it a request and a process ID. The following details are not a replacement for the main pages of ptrace(2), although some descriptions were borrowed from the main pages.
Here's the synopsis:
#include <sys/ptrace.h> long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data);
ptrace request types
Here is a list of requests that are most commonly used when using ptrace to interact with a process image:
|
Request |
Description |
|---|---|
|
|
Attach to the process specified in |
|
|
Indicates that this process is to be traced by its parent. A process probably shouldn't make this request if its parent isn't expecting... |