struct task_struct *task

for (task = current; task != Sinit task; task = task->parent)
;

/*  task     init */

,    ,     
  . , ,      
.     ,       -
 .           -
,      - ,  -
   :

list entry(task->tasks.next, struct task struct, tasks)
      .

list entry(task->tasks.prev, struct task struct, tasks)

         next_task (task)
(  ), prev_task (task) (  ).
,  for_each_process (task)     
 .      task    -
  :

struct task struct *task;

for each process(task) {

/*       PID
   */

printk("%s[%d]\n", task->comm, task->pid) ;

)

 ,       ,  
  ,     .
        (  
).

  

   Unix     -
.        
   (spawn).       
 ,     ,   
  .   Unix   ,  
      : fork() ()8.

8   ()       * ().    
 execve (),       execlp (), execle (I,
execvf)  execvpO.

                                                           53