mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-09-20 11:17:20 +08:00
完善了遍历所有进程的内核学习代码...
This commit is contained in:
@@ -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, ¤t->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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user