在父文件夹下创建proc条目

时间:2015-05-24 03:04:21

标签: linux file linux-kernel

我想在/ proc / driver / path下创建一个proc条目,

我正在使用此代码:

 struct file *fp = filp_open("/proc/driver",O_RDONLY,0);
 struct proc_dir_entry *parent ;
 parent =  PDE(fp->f_dentry->d_inode);
 filp_close(fp, NULL);
 proc_create("leds",0,parent,&proc_fops);

但是当编译我遇到错误时:

error: implicit declaration of function ‘PDE’ [-Werror=implicit-function-declaration]

我该如何解决这个问题? 提前谢谢。

1 个答案:

答案 0 :(得分:2)

您是否包含头文件包含PDE声明?

相关问题