mirror of
git://git.musl-libc.org/musl
synced 2025-01-31 11:01:34 +00:00
implement ptrace syscall wrapper (untested)
This commit is contained in:
parent
d1d141c5f1
commit
71f7a3c2ce
@ -69,7 +69,7 @@ extern "C" {
|
|||||||
#define PTRACE_EVENT_VFORK_DONE 5
|
#define PTRACE_EVENT_VFORK_DONE 5
|
||||||
#define PTRACE_EVENT_EXIT 6
|
#define PTRACE_EVENT_EXIT 6
|
||||||
|
|
||||||
long int ptrace(int, ...);
|
long ptrace(int, ...);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
18
src/misc/ptrace.c
Normal file
18
src/misc/ptrace.c
Normal file
@ -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);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user