完善了遍历所有进程的内核学习代码...

This commit is contained in:
gatieme
2016-05-09 16:55:54 +08:00
parent 86638ba91c
commit 472636a15a
+4 -1
View File
@@ -46,11 +46,14 @@ static int list_process_init(void)
// because the list of process is an double-linked circular list
// we can also list all the process from the current process
/*
list_for_each(pos, &current->children)
{
pTask = list_entry(pos, struct task_struct, sibling);
printk(KERN_ALERT "%d\t%s\n", pTask->pid, pTask->comm);
}
*/
break;
case 2 :
method = "for_each_process";
@@ -79,7 +82,7 @@ static int list_process_init(void)
static void list_process_exit(void)
{
printk(KERN_ALERT "GOOD BYE!!\n");
printk(KERN_ALERT "GOOD BYE--list process!!\n");
}