about summary refs log tree commit diff
path: root/src/misc/ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/ptrace.c')
-rw-r--r--src/misc/ptrace.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/misc/ptrace.c b/src/misc/ptrace.c
new file mode 100644
index 00000000..1cc00167
--- /dev/null
+++ b/src/misc/ptrace.c
@@ -0,0 +1,18 @@
+#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);
+}