5 #include <sys/ptrace.h>
8 __weak_alias(ptrace
, _ptrace
)
11 long ptrace(int req
, pid_t pid
, long addr
, long data
)
17 m
.PMTRACE_ADDR
= addr
;
19 if (_syscall(PM_PROC_NR
, PTRACE
, &m
) < 0) return(-1);
21 /* There was no error, but -1 is a legal return value. Clear errno if
22 * necessary to distinguish this case. _syscall has set errno to nonzero
25 if (m
.m2_l2
== -1) errno
= 0;