ptrace.c (f01387d2693813eb5271a3448e6a082322c7d75d) | ptrace.c (743162013d40ca612b4cb53d3a200dff2d9ab26e) |
---|---|
1/* 2 * linux/kernel/ptrace.c 3 * 4 * (C) Copyright 1999 Linus Torvalds 5 * 6 * Common interfaces for "ptrace()" which we do not want 7 * to continually duplicate across every architecture. 8 */ --- 14 unchanged lines hidden (view full) --- 23#include <linux/syscalls.h> 24#include <linux/uaccess.h> 25#include <linux/regset.h> 26#include <linux/hw_breakpoint.h> 27#include <linux/cn_proc.h> 28#include <linux/compat.h> 29 30 | 1/* 2 * linux/kernel/ptrace.c 3 * 4 * (C) Copyright 1999 Linus Torvalds 5 * 6 * Common interfaces for "ptrace()" which we do not want 7 * to continually duplicate across every architecture. 8 */ --- 14 unchanged lines hidden (view full) --- 23#include <linux/syscalls.h> 24#include <linux/uaccess.h> 25#include <linux/regset.h> 26#include <linux/hw_breakpoint.h> 27#include <linux/cn_proc.h> 28#include <linux/compat.h> 29 30 |
31static int ptrace_trapping_sleep_fn(void *flags) 32{ 33 schedule(); 34 return 0; 35} 36 | |
37/* 38 * ptrace a task: make the debugger its new parent and 39 * move it to the ptrace list. 40 * 41 * Must be called with the tasklist lock write-held. 42 */ 43void __ptrace_link(struct task_struct *child, struct task_struct *new_parent) 44{ --- 321 unchanged lines hidden (view full) --- 366 retval = 0; 367unlock_tasklist: 368 write_unlock_irq(&tasklist_lock); 369unlock_creds: 370 mutex_unlock(&task->signal->cred_guard_mutex); 371out: 372 if (!retval) { 373 wait_on_bit(&task->jobctl, JOBCTL_TRAPPING_BIT, | 31/* 32 * ptrace a task: make the debugger its new parent and 33 * move it to the ptrace list. 34 * 35 * Must be called with the tasklist lock write-held. 36 */ 37void __ptrace_link(struct task_struct *child, struct task_struct *new_parent) 38{ --- 321 unchanged lines hidden (view full) --- 360 retval = 0; 361unlock_tasklist: 362 write_unlock_irq(&tasklist_lock); 363unlock_creds: 364 mutex_unlock(&task->signal->cred_guard_mutex); 365out: 366 if (!retval) { 367 wait_on_bit(&task->jobctl, JOBCTL_TRAPPING_BIT, |
374 ptrace_trapping_sleep_fn, TASK_UNINTERRUPTIBLE); | 368 TASK_UNINTERRUPTIBLE); |
375 proc_ptrace_connector(task, PTRACE_ATTACH); 376 } 377 378 return retval; 379} 380 381/** 382 * ptrace_traceme -- helper for PTRACE_TRACEME --- 842 unchanged lines hidden --- | 369 proc_ptrace_connector(task, PTRACE_ATTACH); 370 } 371 372 return retval; 373} 374 375/** 376 * ptrace_traceme -- helper for PTRACE_TRACEME --- 842 unchanged lines hidden --- |