diff options
| author | Daniel Jacobowitz <drow@nevyn.them.org> | 2002-09-17 11:50:35 -0400 |
|---|---|---|
| committer | Daniel Jacobowitz <drow@nevyn.them.org> | 2002-09-17 11:50:35 -0400 |
| commit | acc7088569c8eef04eeed0eff51d23bb5bcff964 (patch) | |
| tree | db94db9a51ff744719909b8f097f9d35635325e1 /kernel | |
| parent | 1ab068b34497d982070c6e29abff164c74a6302f (diff) | |
Factor out common ptrace code and PTRACE_SETOPTIONS
Support PTRACE_O_TRACESYSGOOD on all platforms
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/ptrace.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index cc7a76bb65b7..ab3aa39a38cf 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -248,3 +248,35 @@ int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int } return copied; } + +int ptrace_setoptions(struct task_struct *child, long data) +{ + if (data & PTRACE_O_TRACESYSGOOD) + child->ptrace |= PT_TRACESYSGOOD; + else + child->ptrace &= ~PT_TRACESYSGOOD; + + if ((data & PTRACE_O_TRACESYSGOOD) != data) + return -EINVAL; + + return 0; +} + +int ptrace_request(struct task_struct *child, long request, + long addr, long data) +{ + int ret = -EIO; + + switch (request) { +#ifdef PTRACE_OLDSETOPTIONS + case PTRACE_OLDSETOPTIONS: +#endif + case PTRACE_SETOPTIONS: + ret = ptrace_setoptions(child, data); + break; + default: + break; + } + + return ret; +} |
