error:unknown field ioctl specified in initializer
2015-11-24 17:40
369 查看
在linux-2.6.36内核上加载编译驱动时,出现
error:unknown field 'ioctl' specified in initializer
原因是:在2.6.36内核上file_operations发生了重大的改变:
原先的
int (*ioctl)(struct inode*, struct file*, unsigned int, unsigned long);
被改为了
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
因而在实际驱动中,我们需要将原先的写的ioctl函数头给改成下面的unlocked_ioctl,在file_operations结构体的填充中也是一样。
error:unknown field 'ioctl' specified in initializer
原因是:在2.6.36内核上file_operations发生了重大的改变:
原先的
int (*ioctl)(struct inode*, struct file*, unsigned int, unsigned long);
被改为了
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
因而在实际驱动中,我们需要将原先的写的ioctl函数头给改成下面的unlocked_ioctl,在file_operations结构体的填充中也是一样。
相关文章推荐
- c3.js 文档翻译(二)
- 推荐10个很棒的AngularJS学习指南
- 四、JavaScript注释
- pulltorefresh 刷新与 nestedscroll 冲突的解决办法
- <2>Android HAL 发展。文件。两种架构。实例解析
- Objective-C——消息、Category和Protocol
- iOS学习笔记(十六)——数据库操作(使用FMDB)
- 阻塞,非阻塞,同步,异步
- 【C语言】【指针相关知识小结】
- 爬虫-scrapy安装(新)
- Azure Website - UTC Time and Local Time
- 【计算机网络】:tcp报文详解
- 子线程和主线程业务依次执行循环50次
- 同步调用、回调和异步调用区别
- iOS 官方文档 UIView
- Insert select 和 update select 操作
- SpringMVC+Spring+Hibernate的小例子
- bootstrap, boosting, bagging 几种方法的联系
- 第三方开源水面波浪波形view:WaveView
- iOS学习笔记--04 NSUserDefaults