2013-10-26 18 views
2

드라이버 모듈을 컴파일하는 동안 "proc_create '함수의"암시 적 선언 "오류가 발생합니다./proc에 항목을 만들고 원하는 수의 프로그램을 인쇄하려고합니다. 모듈을 사용하여. 여기서 뭐가 잘못 됐는지 알려주시겠습니까 ?? 여기 내 코드가있다.오류 : 암시 적으로 'proc_create'함수의 암시 적 선언

#include<linux/module.h> 
#include<linux/fs.h> 

#define HELLO_MAJOR 234 
static int debug_enable = 0; 
static int no_of_access; 
module_param(debug_enable, int, 0); 
MODULE_PARM_DESC(debug_enable, "Enable module debug mode."); 
struct file_operations hello_fops; 
struct proc_dir_entry *proc_file_entry; 

<File operation functions...> 
<Incremented global_counter in the file open operation.> 

static int hello1_read_proc(char *buf, char **start, off_t offset, 
          int count, int *eof, void *data) 
{ 
    int len=0; 
    len += sprintf(buf+len, no_of_access); 
    *eof=1; 
    return len; 

} 

static int __init hello_init(void) 
{ 
    int ret; 
    proc_file_entry = proc_create("examples/hello1", 0,NULL, hello1_read_proc); 
    if(proc_file_entry == NULL) 
      return -ENOMEM; 
    printk("\nProc file entry for hello1 has been created !!!\n"); 

} 

static void __exit hello_exit(void) 
{ 
    printk("Hello Example Exit\n"); 
    remove_proc_entry("exmaples/hello1", NULL); 
    unregister_chrdev(HELLO_MAJOR,"hello1"); 
} 

미리 감사드립니다.

답변

3

<linux/proc_fs.h>

관련 문제