错误: 初始值设定项里有未知的字段‘ioctl’
来源:互联网 发布:anjular.js 编辑:程序博客网 时间:2024/05/01 01:25
这个错误网上搜索发现3.0.0.15版本内核 file_operation结构体已经删除了ioctl函数,取代的是:
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
在file_operation 赋值处修改:
.unlocked_ioctl = xxx_ioctl
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
file_operation结构体在 /usr/src/linux-3.0.0.15/include/linux/fs.h定义。
1546 struct file_operations { 1547 struct module *owner; 1548 loff_t (*llseek) (struct file *, loff_t, int); 1549 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 1550 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 1551 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); 1552 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); 1553 int (*readdir) (struct file *, void *, filldir_t); 1554 unsigned int (*poll) (struct file *, struct poll_table_struct *); 1555 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 1556 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1557 int (*mmap) (struct file *, struct vm_area_struct *); 1558 int (*open) (struct inode *, struct file *); 1559 int (*flush) (struct file *, fl_owner_t id); 1560 int (*release) (struct inode *, struct file *); 1561 int (*fsync) (struct file *, int datasync); 1562 int (*aio_fsync) (struct kiocb *, int datasync); 1563 int (*fasync) (int, struct file *, int); 1564 int (*lock) (struct file *, int, struct file_lock *); 1565 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1566 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1567 int (*check_flags)(int); 1568 int (*flock) (struct file *, int, struct file_lock *); 1569 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1570 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1571 int (*setlease)(struct file *, long, struct file_lock **); 1572 long (*fallocate)(struct file *file, int mode, loff_t offset, 1573 loff_t len); 1574 };2.6.30.4中file_operation的定义如下:
1484 struct file_operations { 1485 struct module *owner; 1486 loff_t (*llseek) (struct file *, loff_t, int); 1487 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 1488 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 1489 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); 1490 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); 1491 int (*readdir) (struct file *, void *, filldir_t); 1492 unsigned int (*poll) (struct file *, struct poll_table_struct *); 1493 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); 1494 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 1495 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1496 int (*mmap) (struct file *, struct vm_area_struct *); 1497 int (*open) (struct inode *, struct file *); 1498 int (*flush) (struct file *, fl_owner_t id); 1499 int (*release) (struct inode *, struct file *); 1500 int (*fsync) (struct file *, struct dentry *, int datasync); 1501 int (*aio_fsync) (struct kiocb *, int datasync); 1502 int (*fasync) (int, struct file *, int); 1503 int (*lock) (struct file *, int, struct file_lock *); 1504 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1505 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1506 int (*check_flags)(int); 1507 int (*flock) (struct file *, int, struct file_lock *); 1508 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1509 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1510 int (*setlease)(struct file *, long, struct file_lock **); 1511 };
在file_operation 赋值处修改:
.unlocked_ioctl = xxx_ioctl
- 错误: 初始值设定项里有未知的字段‘ioctl’
- 错误: 初始值设定项里有未知的字段‘ioctl’
- 错误: 初始值设定项里有未知的字段‘ioctl’
- 字段初始值设定项无法引用非静态字段、方法或属性的问题
- 奇怪的类型初始值设定项异常
- 类工厂创建对象时出现 “BLL.UserBLL”的类型初始值设定项引发异常。错误
- “Microsoft.SqlServer.Management.Dmf.PolicyStore”的类型初始值设定项引发错误
- zhgl 错误 其他信息: “Oracle.DataAccess.Client.OracleConnection”的类型初始值设定项引发异常。
- .NET出现错误“类型初始值设定项引发异常”解决方案
- "<Module>"的类型初始值设定项引发异常的解决办法
- 类型初始值设定项引发异常的解决方法
- NHibernate.Cfg.Configuration”的类型初始值设定项引发异常
- DAL.SQLHelper 的类型初始值设定项引发异常
- 类型初始值设定项引发异常的解决方案
- “OSGeo.OGR.Ogr”的类型初始值设定项引发异常
- 项目中 XX的类型初始值设定项引发异常
- 单元测试System.TypeInitializationException: ......的类型初始值设定项引发异常
- Emgu.CV.CvInvoke的类型初始值设定项引发异常
- Linux静态链接(库)、动态链接(库)、可执行文件加载相关问题
- globalmem.c:193:2: 错误:隐式声明函数‘kmalloc’ [-Werror=implicit-function-declaration]
- 日记2012-8-9
- Android ApiDemo学习(四)Views—— 4 Expandable Lists、Focus、Gallery
- 镁天三国育将篇
- 错误: 初始值设定项里有未知的字段‘ioctl’
- php_network_getaddresses: getaddrinfo failed
- HTML5应用与原生应用之间的差异
- Nginx:页面输出缓存(页面静态化)的设计方案?
- nefu 394 素数价值(dp或规律)
- 学习是一个反复的过程!
- 结构化查询语言(Structured Query Language)
- 编译内核常用命令
- Git 版本控制系統(3) 還沒 push 前可以做的事