Linux设备驱动程序学习
之前在Ubuntu里编译scull时有错误,还好有网友提供了解决办法,即删除config.h文件和增加#include 两个头文件:capability.h和sched.h
最近将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
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20