aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-04-02 19:58:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:05:00 -0400
commit39c626ae47c469abdfd30c6e42eff884931380d6 (patch)
tree58cbe75bac79ce8ef55c94189df26448d0283918 /include
parent7f5d3652d469cdf9eb2365dfea7ce3fb9e1409cc (diff)
forget_original_parent: split out the un-ptrace part
By discussion with Roland. - Rename ptrace_exit() to exit_ptrace(), and change it to do all the necessary work with ->ptraced list by its own. - Move this code from exit.c to ptrace.c - Update the comment in ptrace_detach() to explain the rechecking of the child->ptrace. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "Metzger, Markus T" <markus.t.metzger@intel.com> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/sched.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 1a2b0cb55535..67c15653fc23 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -94,7 +94,7 @@ extern void ptrace_notify(int exit_code);
94extern void __ptrace_link(struct task_struct *child, 94extern void __ptrace_link(struct task_struct *child,
95 struct task_struct *new_parent); 95 struct task_struct *new_parent);
96extern void __ptrace_unlink(struct task_struct *child); 96extern void __ptrace_unlink(struct task_struct *child);
97extern int __ptrace_detach(struct task_struct *tracer, struct task_struct *p); 97extern void exit_ptrace(struct task_struct *tracer);
98extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags); 98extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags);
99#define PTRACE_MODE_READ 1 99#define PTRACE_MODE_READ 1
100#define PTRACE_MODE_ATTACH 2 100#define PTRACE_MODE_ATTACH 2
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9186f8c5d5f2..b47c94e7560b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2061,6 +2061,11 @@ static inline int thread_group_empty(struct task_struct *p)
2061#define delay_group_leader(p) \ 2061#define delay_group_leader(p) \
2062 (thread_group_leader(p) && !thread_group_empty(p)) 2062 (thread_group_leader(p) && !thread_group_empty(p))
2063 2063
2064static inline int task_detached(struct task_struct *p)
2065{
2066 return p->exit_signal == -1;
2067}
2068
2064/* 2069/*
2065 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring 2070 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
2066 * subscriptions and synchronises with wait4(). Also used in procfs. Also 2071 * subscriptions and synchronises with wait4(). Also used in procfs. Also