提交 71f7a3c2 编写于 作者: R Rich Felker

implement ptrace syscall wrapper (untested)

上级 d1d141c5
......@@ -69,7 +69,7 @@ extern "C" {
#define PTRACE_EVENT_VFORK_DONE 5
#define PTRACE_EVENT_EXIT 6
long int ptrace(int, ...);
long ptrace(int, ...);
#ifdef __cplusplus
}
......
#include <sys/ptrace.h>
#include <stdarg.h>
#include <unistd.h>
#include "syscall.h"
long ptrace(int req, ...)
{
va_list ap;
pid_t pid;
void *addr, *data, *addr2;
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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册