struct my_proc_data mydata; struct task_struct *task; int count;
static struct proc_dir_entry *example_dir; static struct proc_dir_entry *date_file; static int param; char temp[15];
module_param(param, int , 0644); //璇绘枃浠秏yfile 鐨勮?椹卞姩鍑芥暟
static int proc_read(char *page, char **start,off_t off,int count,int *eof,void *data ){ int len=0;
struct my_proc_data *mydatap = (struct my_proc_data *) data;
len+=sprintf(page,\//灏嗗瓧绗︿覆鏍煎紡鍖? //鍙?互鐩存帴浣跨敤鍐呮牳鍙橀噺 return len; }
//鍐欐枃浠秏yfile鐨勫啓椹卞姩鍑芥暟 ,鎶妋ydata鐨勬暟鍊煎啓鍒版枃浠朵腑
static int proc_write(struct file *file,const char *buffer,unsigned long count,void *data){ //file鐩存帴灏辨槸myfile?buffer鎸囧悜鐨勬槸鐢ㄦ埛绌洪棿鐨勪粈涔堟暟鎹?紵 int len ;
struct my_proc_data *mydatap = (struct my_proc_data *) data; if(count>MYDATA_LEN) len = MYDATA_LEN; else
len = count; //闀垮害鏈