Open GoogleCodeExporter opened 9 years ago
原因是:generic-2.6/filesdrivers/char/gpio_dev.c中有如下的引用,使�
��到了ioctl项!
struct file_operations gpio_fops = {
ioctl: gpio_ioctl,
open: gpio_open,
release: gpio_close
};
struct file_operations的定义在linux-2.6.36/include/linux/fs.h
对比了一下linux-2.6.36内核和linux-2.6.35,linux-2.6.32内核,
linux-2.6.36中include/linux/fs.h的struct
file_operations缺少了对ioctl的定义:
--- linux-2.6.36/include/linux/fs.h.orig 2012-06-02 12:07:04.276202387 +0800
+++ linux-2.6.36/include/linux/fs.h 2012-06-02 11:40:57.968201665 +0800
@@ -1494,6 +1494,7 @@ struct file_operations {
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
+ 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);
int (*mmap) (struct file *, struct vm_area_struct *);
解决方法:加入int (*ioctl)的定义!
Original comment by richard....@gmail.com
on 2 Jun 2012 at 4:15
1 openwrt-dreambox也有同样问题!
2 uClibc和eglibc都有这样的问题(可预见glibc也有该问题)!
Original comment by richard....@gmail.com
on 2 Jun 2012 at 8:36
从Linux
2.6.36开始,基于BKL(大内核锁)的ioctl已经被抛弃,取而代之的�
��unlocked_ioctl。这个在内核文档里面有提及到。
详见:https://dev.openwrt.org.cn/ticket/49
已经修复:https://dev.openwrt.org.cn/changeset/478
Original comment by richard....@gmail.com
on 2 Jun 2012 at 10:12
Original issue reported on code.google.com by
richard....@gmail.com
on 1 Jun 2012 at 7:27