Linux设备驱动程序学习

2014-11-24 08:20:34 · 作者: · 浏览: 2

最近将Ubuntu升级到9.10版本后,重新生成了2.6.31版本的内核树,没想到编译scull模块时出现新的error
error: 'struct task_struct' has no member named 'uid'
error: 'struct task_struct' has no member named 'euid'


struct task_struct定义在include/linux/sched.h中,原来task_struct结构体定义有所改动,将uid和euid等挪到cred中,见include/linux/sched.h和include/linux/cred.h。


因此只需要将报error的代码做如下修改
current->uid 修改为 current->cred->uid
current->euid 修改为 current->cred->euid