Linux驱动开发④--unknown field ‘ioctl’ specified in initializer .ioctl = xxx
2017-01-09 11:49
393 查看
在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结构体的填充中也是一样。
相关文章推荐
- error : unknown field 'ioctl' specified in initializer
- 内核新的ioctl方式--unlocked_ioctl和compat_ioctl(解决error:unknown field 'ioctl' specified in initializer)
- error: unknown field 'ioctl' specified in initializer (1)
- error: unknown field ‘ioctl’ specified in initializer
- error: unknown field ‘ioctl’ specified in initializer
- linux驱动开发之字符设备--内核和用户空间数据的交换(ioctl)
- Linux简单设备驱动(2): file_operations的write、read、ioctl驱动及Android应用层开发验证
- error: unknown field 'ioctl' specified in initializer问题
- Ralink雷凌rt3070驱动的ARM平台移植问题<error: unknown field ‘private’ specified in initializer>
- 解决 error: unknown field 'ioctl' specified in initializer 的一种方法
- error: unknown field 'ioctl' specified in initializer问题
- error: unknown field ‘ioctl’ specified in initializer
- yaffs,linux3.11,内核编译时报错, error: unknown field 'readdir' specified in initializer
- error: unknown field ‘ioctl’ specified in initializer
- Linux 字符设备驱动开发基础(四)—— ioctl() 函数解析
- error: unknown field ‘ioctl’ specified in initializer
- error:unknown field 'ioctl' specified in initializer
- error: unknown field 'ioctl' specified in initializer问题
- unknown field 'ioctl' specified in initializer
- 【Linux开发】linux设备驱动归纳总结(三):4.ioctl的实现