1 #include <sys/ptrace.h>
6 long ptrace(int req
, ...)
10 void *addr
, *data
, *addr2
= 0;
14 pid
= va_arg(ap
, pid_t
);
15 addr
= va_arg(ap
, void *);
16 data
= va_arg(ap
, void *);
17 /* PTRACE_{READ,WRITE}{DATA,TEXT} (16...19) are specific to SPARC. */
18 #ifdef PTRACE_READDATA
19 if ((unsigned)req
- PTRACE_READDATA
< 4)
20 addr2
= va_arg(ap
, void *);
24 if (req
-1U < 3) data
= &result
;
25 ret
= syscall(SYS_ptrace
, req
, pid
, addr
, data
, addr2
);
27 if (ret
< 0 || req
-1U >= 3) return ret
;