错误:函数'create_proc_entry'的隐式声明

时间:2015-07-09 07:03:17

标签: linux kernel linux-device-driver

内核版本:3.13.0-32-generic

当我构建模块时出现错误

  

make -C /lib/modules/3.13.0-32-generic/build   M = / home / wipro / Downloads / proc modules make [1]:进入目录   /usr/src/linux-headers-3.13.0-32-generic' CC [M] /home/wipro/Downloads/proc/proc.o /home/wipro/Downloads/proc/proc.c: In function ‘proc_win_init’: /home/wipro/Downloads/proc/proc.c:21:5: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration] if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) { ^ /home/wipro/Downloads/proc/proc.c:21:15: warning: assignment makes pointer from integer without a cast [enabled by default] if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) { ^ /home/wipro/Downloads/proc/proc.c:25:9: error: dereferencing pointer to incomplete type file->read_proc = time_read; ^ /home/wipro/Downloads/proc/proc.c:26:9: error: dereferencing pointer to incomplete type file->write_proc = time_write; ^ /home/wipro/Downloads/proc/proc.c:32:9: error: dereferencing pointer to incomplete type link->uid = 0; ^ /home/wipro/Downloads/proc/proc.c:33:9: error: dereferencing pointer to incomplete type link->gid = 100; ^ cc1: some warnings being treated as errors make[2]: *** [/home/wipro/Downloads/proc/proc.o] Error 1 make[1]: *** [_module_/home/wipro/Downloads/proc] Error 2 make[1]: Leaving directory / usr / src / linux-headers-3.13.0-32-generic'make:***   [默认]错误2

如何删除错误

1 个答案:

答案 0 :(得分:4)

自3.10内核版本以来,

create_proc_entry已被删除。另一种方法是使用proc_create。有关详细信息,请参阅question