diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2007-07-17 07:03:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:03 -0400 |
commit | 7664732315c97f48dba9d1e7339ad16fc5a320ac (patch) | |
tree | 1eb9639b0fbe3f24341cecf1dafcae192cb7bde7 /kernel | |
parent | bcdcd8e725b923ad7c0de809680d5d5658a7bf8c (diff) |
PTRACE_PEEKDATA consolidation
Identical implementations of PTRACE_PEEKDATA go into generic_ptrace_peekdata()
function.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/ptrace.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index b1d11f1c7cf7..1653d35419a1 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -490,3 +490,14 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | |||
490 | return ret; | 490 | return ret; |
491 | } | 491 | } |
492 | #endif /* __ARCH_SYS_PTRACE */ | 492 | #endif /* __ARCH_SYS_PTRACE */ |
493 | |||
494 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data) | ||
495 | { | ||
496 | unsigned long tmp; | ||
497 | int copied; | ||
498 | |||
499 | copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0); | ||
500 | if (copied != sizeof(tmp)) | ||
501 | return -EIO; | ||
502 | return put_user(tmp, (unsigned long __user *)data); | ||
503 | } | ||