about summary refs log tree commit diff
path: root/src/misc/ptrace.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-15 13:03:13 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-15 13:03:13 -0400
commit71f7a3c2ce7377a6c77f46524002505b9454861b (patch)
treee82f10fc18d71481d8c11014b362910994192985 /src/misc/ptrace.c
parentd1d141c5f128d2ea6efa0e5aad25c3f8af41cadc (diff)
downloadmusl-71f7a3c2ce7377a6c77f46524002505b9454861b.tar.gz
musl-71f7a3c2ce7377a6c77f46524002505b9454861b.tar.xz
musl-71f7a3c2ce7377a6c77f46524002505b9454861b.zip
implement ptrace syscall wrapper (untested)
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);
+}