Ioctl设备方法
执行make后显示
error: implicit declaration of function'kmalloc'
error: implicit declaration of function'kfree'
经查到是缺少头文件#include <linux/slab.h>
然后再make后显示:错误:初始值设定项里有未知的字段‘ioctl’
这个错误原来是新的内核里面已经删除了ioctl函数,取代的是
long (*unlocked_ioctl) (struct file *,unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int,unsigned long);