mirror of git://git.musl-libc.org/musl
fix ptrace (maybe)
This commit is contained in:
parent
71f7a3c2ce
commit
d431d4546e
|
@ -8,11 +8,18 @@ long ptrace(int req, ...)
|
|||
va_list ap;
|
||||
pid_t pid;
|
||||
void *addr, *data, *addr2;
|
||||
long ret, result;
|
||||
|
||||
va_start(ap, req);
|
||||
pid = va_arg(ap, pid_t);
|
||||
addr = va_arg(ap, void *);
|
||||
data = va_arg(ap, void *);
|
||||
addr2 = va_arg(ap, void *);
|
||||
va_end(ap);
|
||||
return syscall(SYS_ptrace, req, pid, addr, data, addr2);
|
||||
|
||||
if (req<4U) data = &result;
|
||||
ret = syscall(SYS_ptrace, req, pid, addr, data, addr2);
|
||||
|
||||
if (ret<0 || req>=4U) return ret;
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue