aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-17 12:15:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-17 12:15:23 -0400
commit42fea1f385e99a1db979eb75c8a53c0baad0d9f6 (patch)
treeabac6ecf700b671cd970ef3dd21d9201e79f7090 /include
parent7259d936c6af216198ae6af3a25ac6c9dbdbe779 (diff)
parent666f164f4fbfa78bd00fb4b74788b42a39842c64 (diff)
Merge branch 'ptrace-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-utrace
* 'ptrace-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-utrace: fix dangling zombie when new parent ignores children do_wait: return security_task_wait() error code in place of -ECHILD ptrace children revamp do_wait reorganization
Diffstat (limited to 'include')
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/sched.h26
2 files changed, 14 insertions, 16 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9927a88674a3..93c45acf249a 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -140,8 +140,8 @@ extern struct group_info init_groups;
140 .nr_cpus_allowed = NR_CPUS, \ 140 .nr_cpus_allowed = NR_CPUS, \
141 }, \ 141 }, \
142 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 142 .tasks = LIST_HEAD_INIT(tsk.tasks), \
143 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ 143 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
144 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \ 144 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
145 .real_parent = &tsk, \ 145 .real_parent = &tsk, \
146 .parent = &tsk, \ 146 .parent = &tsk, \
147 .children = LIST_HEAD_INIT(tsk.children), \ 147 .children = LIST_HEAD_INIT(tsk.children), \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ba2f859c6e4f..1941d8b5cf11 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1062,12 +1062,6 @@ struct task_struct {
1062#endif 1062#endif
1063 1063
1064 struct list_head tasks; 1064 struct list_head tasks;
1065 /*
1066 * ptrace_list/ptrace_children forms the list of my children
1067 * that were stolen by a ptracer.
1068 */
1069 struct list_head ptrace_children;
1070 struct list_head ptrace_list;
1071 1065
1072 struct mm_struct *mm, *active_mm; 1066 struct mm_struct *mm, *active_mm;
1073 1067
@@ -1089,18 +1083,25 @@ struct task_struct {
1089 /* 1083 /*
1090 * pointers to (original) parent process, youngest child, younger sibling, 1084 * pointers to (original) parent process, youngest child, younger sibling,
1091 * older sibling, respectively. (p->father can be replaced with 1085 * older sibling, respectively. (p->father can be replaced with
1092 * p->parent->pid) 1086 * p->real_parent->pid)
1093 */ 1087 */
1094 struct task_struct *real_parent; /* real parent process (when being debugged) */ 1088 struct task_struct *real_parent; /* real parent process */
1095 struct task_struct *parent; /* parent process */ 1089 struct task_struct *parent; /* recipient of SIGCHLD, wait4() reports */
1096 /* 1090 /*
1097 * children/sibling forms the list of my children plus the 1091 * children/sibling forms the list of my natural children
1098 * tasks I'm ptracing.
1099 */ 1092 */
1100 struct list_head children; /* list of my children */ 1093 struct list_head children; /* list of my children */
1101 struct list_head sibling; /* linkage in my parent's children list */ 1094 struct list_head sibling; /* linkage in my parent's children list */
1102 struct task_struct *group_leader; /* threadgroup leader */ 1095 struct task_struct *group_leader; /* threadgroup leader */
1103 1096
1097 /*
1098 * ptraced is the list of tasks this task is using ptrace on.
1099 * This includes both natural children and PTRACE_ATTACH targets.
1100 * p->ptrace_entry is p's link on the p->parent->ptraced list.
1101 */
1102 struct list_head ptraced;
1103 struct list_head ptrace_entry;
1104
1104 /* PID/PID hash table linkage. */ 1105 /* PID/PID hash table linkage. */
1105 struct pid_link pids[PIDTYPE_MAX]; 1106 struct pid_link pids[PIDTYPE_MAX];
1106 struct list_head thread_group; 1107 struct list_head thread_group;
@@ -1876,9 +1877,6 @@ extern void wait_task_inactive(struct task_struct * p);
1876#define wait_task_inactive(p) do { } while (0) 1877#define wait_task_inactive(p) do { } while (0)
1877#endif 1878#endif
1878 1879
1879#define remove_parent(p) list_del_init(&(p)->sibling)
1880#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)
1881
1882#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 1880#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
1883 1881
1884#define for_each_process(p) \ 1882#define for_each_process(p) \