/*
*File : test.c
*Author : DavidLin
*Date : 2014-12-07pm
*Email : linpeng1577@163.com or linpeng1577@gmail.com
*world : the city of SZ, in China
*Ver : 000.000.001
*history : editor time do
* 1)LinPeng 2014-12-07 created this file!
* 2)
*/
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/sched.h>
static int list_init(void)
{
struct task_struct *task;
task = NULL;
for_each_process(task) {
printk("pid = %dn", task->pid);
}
return 0;
}
static void list_exit(void)
{
printk("KERNEL MACRO: for_each_process exitn");
}
module_init(list_init);
module_exit(list_exit);
MODULE_AUTHOR("Linpeng1577");
MODULE_DESCRIPTION("KERNEL 2.6 MACRO STUDY");
MODULE_LICENES(GPL);
原文:http://linpeng.blog.51cto.com/9779987/1596718
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!