• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/kernel/

Lines Matching refs:child

32 void __ptrace_link(struct task_struct *child, struct task_struct *new_parent)
34 BUG_ON(!list_empty(&child->ptrace_list));
35 if (child->parent == new_parent)
37 list_add(&child->ptrace_list, &child->parent->ptrace_children);
38 remove_parent(child);
39 child->parent = new_parent;
40 add_parent(child);
46 * signal sent that would resume the child, but didn't because it was in
50 void ptrace_untrace(struct task_struct *child)
52 spin_lock(&child->sighand->siglock);
53 if (child->state == TASK_TRACED) {
54 if (child->signal->flags & SIGNAL_STOP_STOPPED) {
55 child->state = TASK_STOPPED;
57 signal_wake_up(child, 1);
60 spin_unlock(&child->sighand->siglock);
69 void __ptrace_unlink(struct task_struct *child)
71 BUG_ON(!child->ptrace);
73 child->ptrace = 0;
74 if (!list_empty(&child->ptrace_list)) {
75 list_del_init(&child->ptrace_list);
76 remove_parent(child);
77 child->parent = child->real_parent;
78 add_parent(child);
81 if (child->state == TASK_TRACED)
82 ptrace_untrace(child);
88 int ptrace_check_attach(struct task_struct *child, int kill)
94 * possible race where someone else was tracing our child and
96 * we are sure that this is our traced child and that can only
100 if ((child->ptrace & PT_PTRACED) && child->parent == current &&
101 (!(child->ptrace & PT_ATTACHED) || child->real_parent != current)
102 && child->signal != NULL) {
104 spin_lock_irq(&child->sighand->siglock);
105 if (child->state == TASK_STOPPED) {
106 child->state = TASK_TRACED;
107 } else if (child->state != TASK_TRACED && !kill) {
110 spin_unlock_irq(&child->sighand->siglock);
115 wait_task_inactive(child);
129 * because setting up the necessary parent/child relationship
220 static inline void __ptrace_detach(struct task_struct *child, unsigned int data)
222 child->exit_code = data;
224 __ptrace_unlink(child);
226 if (child->exit_state != EXIT_ZOMBIE)
227 wake_up_process(child);
230 int ptrace_detach(struct task_struct *child, unsigned int data)
236 ptrace_disable(child);
240 if (child->ptrace)
241 __ptrace_detach(child, data);
297 static int ptrace_setoptions(struct task_struct *child, long data)
299 child->ptrace &= ~PT_TRACE_MASK;
302 child->ptrace |= PT_TRACESYSGOOD;
305 child->ptrace |= PT_TRACE_FORK;
308 child->ptrace |= PT_TRACE_VFORK;
311 child->ptrace |= PT_TRACE_CLONE;
314 child->ptrace |= PT_TRACE_EXEC;
317 child->ptrace |= PT_TRACE_VFORK_DONE;
320 child->ptrace |= PT_TRACE_EXIT;
325 static int ptrace_getsiginfo(struct task_struct *child, siginfo_t __user * data)
331 if (likely(child->sighand != NULL)) {
333 spin_lock_irq(&child->sighand->siglock);
334 if (likely(child->last_siginfo != NULL)) {
335 lastinfo = *child->last_siginfo;
338 spin_unlock_irq(&child->sighand->siglock);
346 static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
355 if (likely(child->sighand != NULL)) {
357 spin_lock_irq(&child->sighand->siglock);
358 if (likely(child->last_siginfo != NULL)) {
359 *child->last_siginfo = newinfo;
362 spin_unlock_irq(&child->sighand->siglock);
368 int ptrace_request(struct task_struct *child, long request,
378 ret = ptrace_setoptions(child, data);
381 ret = put_user(child->ptrace_message, (unsigned long __user *) data);
384 ret = ptrace_getsiginfo(child, (siginfo_t __user *) data);
387 ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
434 struct task_struct *child;
443 child = find_task_by_pid(pid);
444 if (child)
445 get_task_struct(child);
448 if (!child)
450 return child;
456 struct task_struct *child;
468 child = ptrace_get_task_struct(pid);
469 if (IS_ERR(child)) {
470 ret = PTR_ERR(child);
475 ret = ptrace_attach(child);
479 ret = ptrace_check_attach(child, request == PTRACE_KILL);
483 ret = arch_ptrace(child, request, addr, data);
488 put_task_struct(child);