-        -
,   init.    do_exit ()  
notify_parent (),      forget_original_parent ()
     (reparent),  
.

struct task_struct *p, *reaper = father;

struct list_head *list;

if (father->exit signal != -1)

reaper = prev thread(reaper);

else

reaper = child_reaper;

if (reaper == father)

reaper = child reaper;

     reaper    -
     .        -
,   reaper    child_reaper,
     init. ,    -
 ,         
   ,   .

list_for_each(list, &father->children) {

 = list entry(list, struct task struct, sibling);

reparent thread(p, reaper, child_reaper);

}

list for each (list, &father->ptrace children) {

p = list entry(list, struct task_struct, ptrace_list);

reparent thread(p, reaper, child reaper);

}

        :   -
  child list     ,   -
    ptraced child list.  , 
    ,   (  -i
     2.6).      ptrace, 
     ,   -
 (debugging).       
,          |
 .         -
          .
 ,    ,      
 ,     ,  -
   :      
             
.

       ,
  ,  -      .

62                                                                             3